PHP HTML电子邮件缺少变量数据
我正在发送一封 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论