What to do when PHP mail() function doesn’t work for you

Posted by George Nicolaou

On 19 Aug, 2017
George Nicolaou - Senior Web Developer
When using WordPress

Simply install a plugin called WP Mail SMTP by WPForms

When your SMTP does require authentication

Goto your php.ini file and look for this

mail function. In this section you might see something like

SMTP = localhost

You should change it to something like what is shown below. Make sure you use the same setting like you use in outlook for example for that same domain/account

SMTP = smtp.example.com
smtp_port = 25
username = info@example.com
password = yourmailpassord
sendmail_from = info@example.com

When your SMTP doesn't require authentication

Goto your php.ini file and look for this

mail function. In this section you might see something like

SMTP = localhost

You should change it to something like what is shown below. Make sure you use the same setting like you use in outlook for example for that same domain/account

SMTP = smtp.example.com
smtp_port = 25

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Pin It on Pinterest

Share This
PHP TricksWhat to do when PHP mail() function doesn’t work for you