PHP HTML电子邮件缺少变量数据

发布于 2025-01-17 08:58:53 字数 2023 浏览 0 评论 0原文

我正在发送一封 php 电子邮件,其中包含 html 正文中的脚本。发送消息时,下面脚本中显示的回显输出会很好地显示在屏幕上,但收到的电子邮件正文中缺少该输出。

如何在我的电子邮件中包含此部分?

这是我正在使用的代码

// Put your HTML here
$message = file_get_contents('.message_update.html');
echo $message;
$Date = date('d/m/Y');
$count = 0;

$new_dir = str_replace('_', ' ', $dir);
echo "<font color='blue'>";
echo "The folder name at the website message page is: ", 
$new_dir."<br /></font>";
$message .= 'The folder name at the website message page is: ", 
$new_dir."<br /></font>';
$comparison = array_diff($list2, $list1);

foreach ($comparison as $line) {
echo "Date Update: ", $Date, " : To listen to the ", ++$count, " 

消息点击图片
这里“;

echo '<a href="' . $folder_path, $line . '"><img align="top" 
width="100" height="20"  text-    
align: center; 
src="https://nerjabible.com/images/audio_player1.png" /></a>';
echo ", The ", $count, " message name is entitled:    ", $line. " 
<br />";
}

$message = file_get_contents('.message_update1.html');
echo $message;

// Mail it`

` 第一个 html 文件 .message_update.html 的输出包含在收到的电子邮件的顶部。 然后脚本中的变量丢失了 第二个 .message_update1.html 的输出包含在收到的电子邮件的底部。

如何包装此部分

$new_dir = str_replace('_', ' ', $dir);
echo "<font color='blue'>";
echo "The folder name at the website message page is: ", 
$new_dir."<br /></font>";
$message .= 'The folder name at the website message page is: ", 
$new_dir."<br /></font>';
$comparison = array_diff($list2, $list1);

foreach ($comparison as $line) {
echo "Date Update: ", $Date, " : To listen to the ", ++$count, " 
message click the picture    
here ";

echo '<a href="' . $folder_path, $line . '"><img align="top" 
width="100" height="20"  text-    
align: center; 
src="https://nerjabible.com/images/audio_player1.png" /></a>';
echo ", The ", $count, " message name is entitled:    ", $line. " 
<br />";
}

并将其包含在 $message 变量中?

I am sending a php email with script inside an html body. When the message is sent the echo output shown in the script below displays to the screen nicely, but it is missing from the email body received.

How can I include this section in my email?

This is the code I am using

// Put your HTML here
$message = file_get_contents('.message_update.html');
echo $message;
$Date = date('d/m/Y');
$count = 0;

$new_dir = str_replace('_', ' ', $dir);
echo "<font color='blue'>";
echo "The folder name at the website message page is: ", 
$new_dir."<br /></font>";
$message .= 'The folder name at the website message page is: ", 
$new_dir."<br /></font>';
$comparison = array_diff($list2, $list1);

foreach ($comparison as $line) {
echo "Date Update: ", $Date, " : To listen to the ", ++$count, " 

message click the picture
here ";

echo '<a href="' . $folder_path, $line . '"><img align="top" 
width="100" height="20"  text-    
align: center; 
src="https://nerjabible.com/images/audio_player1.png" /></a>';
echo ", The ", $count, " message name is entitled:    ", $line. " 
<br />";
}

$message = file_get_contents('.message_update1.html');
echo $message;

// Mail it`

`
The output of the first html file .message_update.html is included in top of the email received.
Then the variables from the script are missing
The output of the second .message_update1.html is included at the bottom of the email received.

How can I wrap this section

$new_dir = str_replace('_', ' ', $dir);
echo "<font color='blue'>";
echo "The folder name at the website message page is: ", 
$new_dir."<br /></font>";
$message .= 'The folder name at the website message page is: ", 
$new_dir."<br /></font>';
$comparison = array_diff($list2, $list1);

foreach ($comparison as $line) {
echo "Date Update: ", $Date, " : To listen to the ", ++$count, " 
message click the picture    
here ";

echo '<a href="' . $folder_path, $line . '"><img align="top" 
width="100" height="20"  text-    
align: center; 
src="https://nerjabible.com/images/audio_player1.png" /></a>';
echo ", The ", $count, " message name is entitled:    ", $line. " 
<br />";
}

and include it in the $message variable?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文