PHP

HOW TO FIX MAIL NOT SENDING

(a quick guide)

PHP mail requires an SMTP (simple mail transfer protocol) server to send out emails.

WHY IS EMAIL NOT SENT?

01

EIther SMTP is not properly configured. OR firewall/anti-virus is blocking mail send.

LINUX sudo apt-get install postfix (OR YUM OR RPM - Whichever is the package manager)

INSTALL LOCAL SMTP SERVER (A)

02

PHP.INI Make sure SMTP=localhost

INSTALL LOCAL SMTP SERVER (B)

03

PHP.INI For Windows only, also set sendmail_from=YOUR@EMAIL.COM

Just set the SMTP settings in php.ini accordingly. SMTP=HOST.COM smtp_port=PORT NUMBER auth_username=ID@HOST.COM auth_password=PASSWORD

USE REMOTE SMTP SERVER

04

Allow SMTP in Windows Firewall, Linux IPTABLES, hardware firewall.

Set exception in anti-virus.

Check spam mail folder.

Set mail.log = PATH/LOG.FILE in php.ini, and see the error messages.

OTHER CAUSES & FIXES

05