删除PHP Mailer发送的标头

时间:2014-06-24 18:33:07

标签: javascript php email

我还是php的新手,但是我有点头疼。我的电子邮件发送完美,但在我发送电子邮件后,会显示一个单独的网页,显示所有电子邮件标题信息。我想知道如何去除它?我不希望每个人都看到他们的电子邮件发送到哪里,或者甚至让这个网页显示。在邮件发送成功后,我已经尝试将页面直接转到另一个页面,因此标题显示为一瞬间。我只是希望我的javascript警报显示消息已成功发送,并且很快就会出现。

那么我该如何删除标题?

标题在网页上看起来像这样:

2014-06-24 18:21:01 CLIENT -> SERVER: EHLO localhost 
2014-06-24 18:21:02 CLIENT -> SERVER: AUTH LOGIN 
2014-06-24 18:21:04 CLIENT -> SERVER: bWFyaWV0amllLmRhdmVsMjRAZ21haWwuY29t 
2014-06-24 18:21:05 CLIENT -> SERVER: bWFyaTN0amll 
2014-06-24 18:21:09 CLIENT -> SERVER: MAIL FROM: 
2014-06-24 18:21:10 CLIENT -> SERVER: RCPT TO: 
2014-06-24 18:21:13 CLIENT -> SERVER: DATA 
2014-06-24 18:21:17 CLIENT -> SERVER: Date: Tue, 24 Jun 2014 20:20:52 +0200 
2014-06-24 18:21:17 CLIENT -> SERVER: To: blah@gmail.com 
2014-06-24 18:21:17 CLIENT -> SERVER: From: BLAH 
2014-06-24 18:21:17 CLIENT -> SERVER: Subject: Test7 
2014-06-24 18:21:17 CLIENT -> SERVER: Message-ID: <5ee336b4eab3be7e72dbce2097197e26@localhost> 
2014-06-24 18:21:17 CLIENT -> SERVER: X-Priority: 3 
2014-06-24 18:21:17 CLIENT -> SERVER: X-Mailer: PHPMailer 5.2.8 (https://github.com/PHPMailer/PHPMailer/) 
2014-06-24 18:21:17 CLIENT -> SERVER: MIME-Version: 1.0 
2014-06-24 18:21:17 CLIENT -> SERVER: Content-Type: text/html; charset=iso-8859-1 
2014-06-24 18:21:17 CLIENT -> SERVER: Content-Transfer-Encoding: 8bit 
2014-06-24 18:21:17 CLIENT -> SERVER: 
2014-06-24 18:21:17 CLIENT -> SERVER: Test7 
2014-06-24 18:21:17 CLIENT -> SERVER: 
2014-06-24 18:21:17 CLIENT -> SERVER: . 
2014-06-24 18:21:19 CLIENT -> SERVER: QUIT

1 个答案:

答案 0 :(得分:2)

SMTPDebug为true将输出这些标头,因为它是PHPMailer的开发功能。

对于生产用途,请始终确保关闭调试功能。

$instance->SMTPDebug = false;

在这种情况下。