为什么PHP mailer在发送后将mimeheader打印到屏幕上? [英] Why is PHP mailer printing mimeheader to screen after send?

查看:94
本文介绍了为什么PHP mailer在发送后将mimeheader打印到屏幕上?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是问题所在,我刚刚实现了PHPMailer,并且在发送电子邮件后将Mime Header打印到屏幕上.我正在使用GITHUB上列出的最新PHPMailer代码,尽管已进行了几乎所有操作,但无法找到将其打印到屏幕上的任何原因.让我知道您是否需要更多信息.我似乎无法想到其他任何事情.参见下文:

Here is the problem, I have just implemented PHPMailer and it is printing the Mime Header to the screen after the email is sent. I am using the latest PHPMailer code listed on GITHUB, and I have gone through virtually everything but cant find any reason why this is printing to the screen. Let me know if you need anymore information. I cant seem to think of anything else. See below:

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

这是实现代码:

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;
}

推荐答案

您需要设置

$mail->SMTPDebug = false;  

这篇关于为什么PHP mailer在发送后将mimeheader打印到屏幕上?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆