when i send email it echo many unnecessary texts, i don't want these text to be printed out. how can i disable these text.
example:
SMTP -> FROM SERVER:220 mx.google.com ESMTP p1sm1037082ybn.17
SMTP -> FROM SERVER: 250-mx.google.com at your service, [xxx.xxx.xxx.xxx] 250-SIZE 35651584 250-8BITMIME 250-AUTH LOGIN PLAIN XOAUTH 250 ENHANCEDSTATUSCODES
SMTP -> FROM SERVER:250 2.1.0 OK p1sm1037082ybn.17
SMTP -> FROM SERVER:250 2.1.5 OK p1sm1037082ybn.17
SMTP -> FROM SERVER:354 Go ahead p1sm1037082ybn.17
SMTP -> FROM SERVER:250 2.0.0 OK 1290167720 p1sm1037082ybn.17
i am using class.phpmailer.php file and using $obj.Send() method to send email. ??
thanks
PHPMailer can use a non-local mail server (SMTP) if you have authentication. Further advantages include: It can print various kinds of error messages in more than 40 languages when it fails to send an email. It has integrated SMTP protocol support and authentication over SSL and TLS.
The PHP mail() function usually sends via a local mail server, typically fronted by a sendmail binary on Linux, BSD, and macOS platforms, however, Windows usually doesn't include a local mail server; PHPMailer's integrated SMTP client allows email sending on all platforms without needing a local mail server.
If the web application is built with PHP, the mail() function is used to send email from the script using PHP. But the PHP mail() function will not work in localhost.
If you've created a PHP mail form and find it's not sending email, then it's most often due to the FROM address the form is using in its headers. A simple way to confirm if this is the case: Log in to your web server via FTP or SSH.
PHPMailer has a "debug" flag that you can turn off.
Depending on which version you are using, it could be named Debug
or SMTPDebug
. You'll know it when you see it. If necessary, look into the class file to find out the name.
Set that to false and all is well.
By default it shouldn't generate any output. Make sure it is not wrapped in a print/echo statement/function.
A workaround could be using ob_start()
at the beginning and ob_get_clean()
at the end of your mailer script, so that it prevents any output from leaving the buffer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With