【发布时间】:2012-05-19 10:48:18
【问题描述】:
我需要发送使用 CKEditor 创建的电子邮件并使用 phpmailer 发送。我使用以下代码:
$to =$_POST["toEmail"];
$subject=$_POST["emailSubj"];
$from=$_POST["fromEmail"];
$body= $_POST["editor1"];
$mail = new PHPMailer();
$mail->IsHTML(true);
$mail->From = "example@example.com";
$mail->AddAddress($to);
$mail->Subject = $subject;
$mail->Body = $body;
$mail->WordWrap = 50;
$mail->AltBody="Hello, my friend! \n\n This message uses HTML entities, but you prefer plain text !";
if($mail->Send())
{
echo "Message Send Successfully";
}
但我收到了类似的文字
hi
等等。或者有时纯文本不是 html 电子邮件。我需要做什么才能接收 html 电子邮件。
【问题讨论】:
标签: header ckeditor mime-types phpmailer php