$email_content = <<<EOT<img src="a.png"/ alt="PHPEmail" >EOT;$mail=new PHPMailer();$mail -> SMTPAuth = true; $mail -> Mailer = "smtp";$mail -> WordWrap = 1024;$mail->Body=$email_content; $mail->Send()
$mail->IsHTML(true); // set email format to HTML (是否使用HTML格式)
$mail->AddAttachment("/var/tmp/file.tar.gz"); // 添加附件
没有设置为使用html格式所以html代码被处理了