【发布时间】:2015-09-03 20:48:28
【问题描述】:
我尝试使用summernote
和 PHP Mailer 将内容发送到我的电子邮件。
但电子邮件似乎不是 HTML 格式,尽管我输入了:
$mail->IsHTML(true); //set email format to HTML
以下是我发送电子邮件的代码:
require '../PHPMailerAutoload.php';
$mail = new PHPMailer();
$mail->IsSMTP(); //set mailer to use SMTP
$mail->Host = "mail.xxxyy.com"; //specify SMTP mail server
$mail->Port = "2525"; //specify SMTP Port
$mail->SMTPAuth = true; //turn on SMTP authentication
$mail->Username = "xxxxx@xxxxx.com"; //Full SMTP username
$mail->Password = "xxxxx"; //SMTP password
$mail->From = "xxxxx@xxx.com";
$mail->FromName = "xxxxx";
$mail->AddAddress("xxxxxx", "Mei Yi");
$mail->WordWrap = 50; //optional, you can delete this line
$mail->IsHTML(true); //set email format to HTML
$mail->Subject = "RE:". $_POST[txtFeedbackSubject2];
$mail->Body = htmlspecialchars($_POST['content']);
if(!$mail->Send())
{
echo "Message could not be sent.
";
echo "Mailer Error: " . $mail->ErrorInfo;
exit;
}
echo "Message has been sent";
邮件内容看起来是这样的:
<span style=\"font-weight: bold; font-style: italic; text-decoration: underline;\">Aadadssdasadsad.</span>
请指教。
谢谢。
【问题讨论】:
-
会不会是你的魔术引号启用了?
标签: php html email phpmailer summernote