您好我正在尝试使用php邮件程序类发送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
Run Code Online (Sandbox Code Playgroud)
我的问题是,是否有可能在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>
Run Code Online (Sandbox Code Playgroud)