Since I am a real master at forgiving things I am writing this one down.
PHP mail function relies on sendmail but SELinux by default block webservers from sending emails, the usual error that pop-out is:
sendmail: NOQUEUE: SYSERR(nginx): /etc/mail/sendmail.cf: line 0: cannot open: Permission denied
Allow webservers to send email is as easy as editing the appropriate SELinux boolean:
setsebool -P httpd_can_sendmail 1
Use “sestatus” to check SELinux booleans:
sestatus -b | grep -i sendmail