javascriptphpemail

Removing the PHP Mailer sent header


I am still new to php, but I am struggling a bit with a headache. My emails get send perfectly, but after I send the email, a seperate webpage shows up showing all the email header information. I want to know how do I go about removing it? I don't want everyone to see where their email is sending to, or even getting this web page to show. I already tried taking the page to go directly to another page after the message sending was successful so for a split second the header shows. I just want my javascript alert to appear that the message has been sent successfully and that there will be an attendance shortly.

So how do I go about removing the header?

The header looks like something like this on the web page:

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

Solution

  • SMTPDebug being true will output these headers as it is a development feature for PHPMailer.

    For production use, always make sure debug features are off.

    $instance->SMTPDebug = false;

    in this case.