How to fix: php mail() function not working in CentOS 6

If you’re using SELinux, it’s its fault.
To check:
#getsebool -a | grep mail
If you find this turned off:
httpd_can_sendmail –> on
Just permanently add the expection with:
#setsebool -P httpd_can_sendmail 1

If you’re using postfix instead of sendmail:
In your php.ini, comment out the “sendmail_path” and add this:
sendmail_path = /usr/sbin/sendmail.postfix -t -i

2 thoughts on “How to fix: php mail() function not working in CentOS 6”

Leave a Reply

Your email address will not be published.

Loading Facebook Comments ...
Loading Disqus Comments ...