我正在運行phpmailer,它非常新。 問題定義:無法看到收到的電子郵件中的PHP變量數據,而html內容可以正常顯示。 下面是一些代碼:phpmailer for php變量
require 'PHPMailer/class.phpmailer.php';
$mail = new PHPMailer;
$mail->WordWrap = 50; // Set word wrap to 50 characters
$mail->IsHTML(true); // Set email format to HTML
$mail->Subject = 'Message';
$mail->Body = '<body>
<div align="center"><p7><strong>HELLO WORLD</strong></p7></div>
<h9><u>Details</u></h9><br/>
<h9><strong>NAME:</strong> <?php echo "$name";?> <?php echo "$place";?>
</body>';
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
if(!$mail->Send()) {
echo 'Message could not be sent.';
echo 'Mailer Error: ' . $mail->ErrorInfo;
exit;
}
echo 'Message has been sent';
無法看到下PHP定義的數據。 $ name和$ place也是每個郵件的動態數據。
請幫忙。
你把PHP變量這樣的,並嘗試發送郵件。它會工作很好.. – Manik 2013-03-14 11:09:00