Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prevent PhpMailer from displaying messages

Tags:

php

phpmailer

I have made a successful contact form with phpmailer, however, whenever I display the thank you message , I always get this message.

SMTP -> FROM SERVER:220 mx.google.com ESMTP e2sm28679155qaw.10 - gsmtp 
SMTP -> FROM SERVER: 250-mx.google.com at your service, [##.##.###.##] 250-SIZE 35882577 250-8BITMIME 250-AUTH LOGIN PLAIN XOAUTH XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER 250-ENHANCEDSTATUSCODES 250-PIPELINING 250-CHUNKING 250 SMTPUTF8 
SMTP -> FROM SERVER:250 2.1.0 OK e2sm28679155qaw.10 - gsmtp 
SMTP -> FROM SERVER:250 2.1.5 OK e2sm28679155qaw.10 - gsmtp 
SMTP -> FROM SERVER:354 Go ahead e2sm28679155qaw.10 - gsmtp 
SMTP -> FROM SERVER:250 2.0.0 OK 1416161162 e2sm28679155qaw.10 - gsmtp 
SMTP -> FROM SERVER:221 2.0.0 closing connection e2sm28679155qaw.10 - gsmtp

(##.##.###.##) is where my ip address is.

Can someone please help me get rid fo this message?

Thanks.

like image 991
Witt Avatar asked Nov 30 '22 01:11

Witt


1 Answers

Remove the following line from your phpmailer script.

$mail->SMTPDebug  = 2; 

or

// 0 = off (for production use, No debug messages)
// 1 = client messages
// 2 = client and server messages

https://github.com/PHPMailer/PHPMailer/blob/master/examples/smtp.phps

like image 119
fortune Avatar answered Dec 04 '22 04:12

fortune