为什么PHP mailer会在发送后将MIMHEADER打印到屏幕上?

为什么PHP mailer会在发送后将MIMHEADER打印到屏幕上?,php,email,phpmailer,Php,Email,Phpmailer,问题是,我刚刚实现了PHPMailer,它在发送电子邮件后将Mime头打印到屏幕上。我使用的是GITHUB上列出的最新phpMail代码,我几乎已经浏览了所有内容,但找不到将其打印到屏幕上的任何原因。如果您需要更多信息,请告诉我。我似乎想不出别的了。见下文: 2013-09-30 20:37:14 CLIENT -> SERVER: AUTH LOGIN 2013-09-30 20:37:14 CLIENT -> SERVER: ZGFwaWVjaG9jxXlAZ21haWwuY29

问题是,我刚刚实现了PHPMailer,它在发送电子邮件后将Mime头打印到屏幕上。我使用的是GITHUB上列出的最新phpMail代码,我几乎已经浏览了所有内容,但找不到将其打印到屏幕上的任何原因。如果您需要更多信息,请告诉我。我似乎想不出别的了。见下文:

2013-09-30 20:37:14 CLIENT -> SERVER: AUTH LOGIN
2013-09-30 20:37:14 CLIENT -> SERVER: ZGFwaWVjaG9jxXlAZ21haWwuY29t
2013-09-30 20:37:14 CLIENT -> SERVER: ZHBpZT5HNzE=
2013-09-30 20:37:15 CLIENT -> SERVER: MAIL FROM:<xxxxx@xxxxxx.com>
2013-09-30 20:37:15 CLIENT -> SERVER: RCPT TO:<yyyyy@yyyyyyy.com>
2013-09-30 20:37:15 CLIENT -> SERVER: DATA
2013-09-30 20:37:15 CLIENT -> SERVER: Date: Mon, 30 Sep 2013 16:37:14 -0400
2013-09-30 20:37:15 CLIENT -> SERVER: Return-Path: <xxxxx@xxxxxxx.com>
2013-09-30 20:37:15 CLIENT -> SERVER: To: Someone <yyyyyy@yyyyyyyy.com>
2013-09-30 20:37:15 CLIENT -> SERVER: From: xxxxxxx xxxxx <xxxxx@xxxxxxx.com>
2013-09-30 20:37:15 CLIENT -> SERVER: Subject: xxxxxxx.com Confirmation
2013-09-30 20:37:15 CLIENT -> SERVER: Message-ID: <c22a17772edd75gh89td324ac0fe67ae@localhost>
2013-09-30 20:37:15 CLIENT -> SERVER: X-Priority: 3
2013-09-30 20:37:15 CLIENT -> SERVER: X-Mailer: PHPMailer 5.2.7 (https://github.com/PHPMailer/PHPMailer/)
2013-09-30 20:37:15 CLIENT -> SERVER: MIME-Version: 1.0
2013-09-30 20:37:15 CLIENT -> SERVER: Content-Type: multipart/alternative;
2013-09-30 20:37:15 CLIENT -> SERVER:   boundary="b1_c22a17772edd75gh89td324ac0fe67ae"
2013-09-30 20:37:15 CLIENT -> SERVER: Content-Transfer-Encoding: 8bit
2013-09-30 20:37:15 CLIENT -> SERVER:
2013-09-30 20:37:15 CLIENT -> SERVER: --b1_c22a17772edd75gh89td324ac0fe67ae
2013-09-30 20:37:15 CLIENT -> SERVER: Content-Type: text/plain; charset=iso-8859-1
2013-09-30 20:37:15 CLIENT -> SERVER: Content-Transfer-Encoding: 8bit
2013-09-30 20:37:15 CLIENT -> SERVER:
2013-09-30 20:37:15 CLIENT -> SERVER: This is the text body of the message, it is 
2013-09-30 20:37:15 CLIENT -> SERVER: printed here.  blah blah blah
2013-09-30 20:37:15 CLIENT -> SERVER:
2013-09-30 20:37:15 CLIENT -> SERVER:
2013-09-30 20:37:15 CLIENT -> SERVER: --b1_c22a17772edd75gh89td324ac0fe67ae
2013-09-30 20:37:15 CLIENT -> SERVER: Content-Type: text/html; charset=iso-8859-1
2013-09-30 20:37:15 CLIENT -> SERVER: Content-Transfer-Encoding: 8bit
2013-09-30 20:37:15 CLIENT -> SERVER:
2013-09-30 20:37:15 CLIENT -> SERVER: This is the alternate text body for non-html email that may or may no be reading this.
2013-09-30 20:37:15 CLIENT -> SERVER: This is also the text body
2013-09-30 20:37:15 CLIENT -> SERVER:
2013-09-30 20:37:15 CLIENT -> SERVER:
2013-09-30 20:37:15 CLIENT -> SERVER:
2013-09-30 20:37:15 CLIENT -> SERVER: --b1_c22a17772edd79e8f6fd324ac0fe67ae--
2013-09-30 20:37:15 CLIENT -> SERVER:
2013-09-30 20:37:15 CLIENT -> SERVER: .
2013-09-30 20:37:16 CLIENT -> SERVER: QUIT
2013-09-30 20:37:14客户端->服务器:身份验证登录
2013-09-30 20:37:14客户端->服务器:ZGFwaWVjaG9jxXlAZ21haWwuY29t
2013-09-30 20:37:14客户端->服务器:ZHBpZT5HNzE=
2013-09-30 20:37:15客户端->服务器:邮件发件人:
2013-09-30 20:37:15客户端->服务器:RCPT收件人:
2013-09-30 20:37:15客户端->服务器:数据
2013-09-30 20:37:15客户端->服务器:日期:2013年9月30日星期一16:37:14-0400
2013-09-30 20:37:15客户端->服务器:返回路径:
2013-09-30 20:37:15客户端->服务器:收件人:某人
2013-09-30 20:37:15客户端->服务器:发件人:xxxxxxx xxxxx
2013-09-30 20:37:15客户端->服务器:主题:xxxxxxx.com确认
2013-09-30 20:37:15客户端->服务器:消息ID:
2013-09-30 20:37:15客户端->服务器:X优先级:3
2013-09-30 20:37:15客户端->服务器:X-Mailer:PHPMailer 5.2.7(https://github.com/PHPMailer/PHPMailer/)
2013-09-30 20:37:15客户端->服务器:MIME版本:1.0
2013-09-30 20:37:15客户端->服务器:内容类型:多部分/可选;
2013-09-30 20:37:15客户端->服务器:boundary=“b1_c22a17772edd75gh89td324ac0fe67ae”
2013-09-30 20:37:15客户端->服务器:内容传输编码:8比特
2013-09-30 20:37:15客户端->服务器:
2013-09-30 20:37:15客户端->服务器:--b1_c22a17772edd75gh89td324ac0fe67ae
2013-09-30 20:37:15客户端->服务器:内容类型:文本/普通;字符集=iso-8859-1
2013-09-30 20:37:15客户端->服务器:内容传输编码:8比特
2013-09-30 20:37:15客户端->服务器:
2013-09-30 20:37:15客户端->服务器:这是消息的正文,它是
2013-09-30 20:37:15客户端->服务器:此处打印。废话废话
2013-09-30 20:37:15客户端->服务器:
2013-09-30 20:37:15客户端->服务器:
2013-09-30 20:37:15客户端->服务器:--b1_c22a17772edd75gh89td324ac0fe67ae
2013-09-30 20:37:15客户端->服务器:内容类型:text/html;字符集=iso-8859-1
2013-09-30 20:37:15客户端->服务器:内容传输编码:8比特
2013-09-30 20:37:15客户端->服务器:
2013-09-30 20:37:15客户端->服务器:这是非html电子邮件的备用文本正文,可能正在阅读,也可能没有。
2013-09-30 20:37:15客户端->服务器:这也是文本正文
2013-09-30 20:37:15客户端->服务器:
2013-09-30 20:37:15客户端->服务器:
2013-09-30 20:37:15客户端->服务器:
2013-09-30 20:37:15客户端->服务器:--b1_c22a17772edd79e8f6fd324ac0fe67ae--
2013-09-30 20:37:15客户端->服务器:
2013-09-30 20:37:15客户端->服务器:。
2013-09-30 20:37:16客户端->服务器:退出
以下是实现代码:

require("class.phpmailer.php");

$mail = new PHPMailer;

$mail->From = 'xxxxx@xxxxxxx.com';
$mail->FromName = 'xxxxxxx xxxxx';
$mail->addAddress($email, $fname);                  
$mail->addReplyTo('', '');
$mail->IsSMTP();                            
$mail->SMTPDebug = 1;                       
$mail->SMTPAuth = true;                         
$mail->SMTPSecure = 'ssl';                      
$mail->Host = "smtpout.secureserver.net ";
$mail->Port = 465;                          
$mail->Username = "xxxxx@xxxxxxx.com";
$mail->Password = "password";
$mail->WordWrap = 50;                                       
$mail->isHTML(true);                                        

$mail->Subject = 'xxxxxxx.com Confirmation';
$mail->Body    = "This is the text body of the message, it is printed here.  blah blah blah";
$mail->AltBody = "This is the alternate text body for non-html email that may or may no be reading this.<br />This is also the text body";

if(!$mail->send()) {
   echo 'Message could not be sent.';
   echo 'Mailer Error: ' . $mail->ErrorInfo;
   exit;
}
require(“class.phpmailer.php”);
$mail=新的PHPMailer;
$mail->Fromxxxxx@xxxxxxx.com';
$mail->FromName='xxxxxxxxxxx';
$mail->addAddress($email,$fname);
$mail->addReplyTo(“”,”);
$mail->IsSMTP();
$mail->SMTPDebug=1;
$mail->SMTPAuth=true;
$mail->SMTPSecure='ssl';
$mail->Host=“smtpout.secureserver.net”;
$mail->Port=465;
$mail->Username=”xxxxx@xxxxxxx.com";
$mail->Password=“Password”;
$mail->WordWrap=50;
$mail->isHTML(true);
$mail->Subject='xxxxxxx.com确认';
$mail->Body=“这是邮件的文本正文,打印在这里。诸如此类”;
$mail->AltBody=“这是非html电子邮件的备用文本正文,可能正在阅读,也可能没有阅读。
这也是文本正文”; 如果(!$mail->send()){ echo“无法发送消息”; 回显“邮件错误:”。$mail->ErrorInfo; 出口 }
您需要设置

$mail->SMTPDebug = false;  

就我个人而言,我希望
SMTPDebug
写入错误日志,而不是回显屏幕

将其添加到PHPMailer配置以启用此行为:

$mail->Debugoutput = 'error_log';
谢天谢地,这是支持的,只是不是默认的