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

Pin It on Pinterest

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