BASSEL
BASSEL

Reputation: 27

phpmailer prints long list of details (CLIENT -> SERVER) when sending email

I have got a script working with PHPMailer.

When i run it to send an email, the PHPMailer send the email successfully.

But ALSO echo long list of email sending information (CLIENT -> SERVER) like:

SERVER -> CLIENT: 220-server.mywebsitese.com ESMTP Exim 4.84 #2 Tue, 27 Jan 2015 08:37:57 +0200 220-We do not authorize the use of this system to transport unsolicited, 220 and/or bulk e-mail.
CLIENT -> SERVER: EHLO www.mywebsite.com
SERVER -> CLIENT: 250-server.mywebsite.com Hello server.mywebsite.com [xx.xxx.xx.xx]250-SIZE 52428800250-8B9uLITMIME250-PIPELINING250-AUTH PLAIN LOGIN250-STARTTLS250 HELP
CLIENT -> SERVER: AUTH LOGIN
SERVER -> CLIENT: 334 VXNlcm5h9uLbWU6
CLIENT -> SERVER: bm9yZXBseUBsZWJh9uLbm9uLWxvdHRvLmNvbQ==
SERVER -> CLIENT: 334 UGFzc39uLdvcmQ6
.
.
.
.Very
.
.
.Long
.
.
.List of SERVER -> CLIENT / CLIENT SERVER
.
Message sent!

The script activated by:

            if (!$mail->send()) {
            echo "Mailer Error: " . $mail->ErrorInfo;
            } else {
            echo "Message sent!";

What I really want is to only send the email, print MESSAGE SENT, no need of this long list..

Is this easily done?

Thanks

Upvotes: 2

Views: 3009

Answers (4)

Naresh
Naresh

Reputation: 1

$mail->SMTPDebug = 0; This is working for my script.

Upvotes: 0

Yildirim Erdemli
Yildirim Erdemli

Reputation: 109

PHPMailer has 4 levels for debugging. Debugging closes with 0.

  • SMTP::DEBUG_OFF (0): Disable debugging (you can also leave this out completely, 0 is the default).
  • SMTP::DEBUG_CLIENT (1): Output messages sent by the client.
  • SMTP::DEBUG_SERVER (2): as 1, plus responses received from the server (this is the most useful setting).
  • SMTP::DEBUG_CONNECTION (3): as 2, plus more information about the initial connection - this level can help diagnose STARTTLS failures.
  • SMTP::DEBUG_LOWLEVEL (4): as 3, plus even lower-level information, very verbose, don't use for debugging SMTP, only low-level problems.

For more detailed information, you can view PHPMailer's official github account.

Upvotes: 1

Deepti Gehlot
Deepti Gehlot

Reputation: 617

Use $mail->SMTPDebug = 0;, it worked for me!

Upvotes: 1

Cyclonecode
Cyclonecode

Reputation: 29991

This seems to be debug information. Try to disable debugging by setting SMTPDebug to 0 right after you have created an instance of PHPMailer:

$mail = new PHPMailer();
$mail->SMTPDebug = 0;

Upvotes: 2

Related Questions