您好我正在尝试使用 php mailer 类发送 html 电子邮件。问题是我想在我的电子邮件中包含 php 变量,同时使用包含来保持事情井井有条。这是我的 php 邮件程序....
$place = $data['place'];
$start_time = $data['start_time'];
$mail->IsHTML(true); // set email format to HTML
$mail->Subject = "You have an event today";
$mail->Body = file_get_contents('../emails/event.html');
$mail->Send(); // send message
我的问题是,是否可以在 event.html 中有 php 变量?我试过这个没有运气(下面是event.html)..
<table width='600px' cellpadding='0' cellspacing='0'>
<tr><td bgcolor='#eeeeee'><img src='logo.png' /></td></tr>
<tr><td bgcolor='#ffffff' bordercolor='#eeeeee'>
<div style='border:1px solid #eeeeee;font-family:Segoe UI,Tahoma,Verdana,Arial,sans-serif;padding:20px 10px;'>
<p style=''>This email is to remind you that you have an upcoming meeting at $place on $start_time.</p>
<p>Thanks</p>
</div>
</td></tr>
</table>