Using mail() causes 504 Gateway Time-out in Nginx Using mail() causes 504 Gateway Time-out in Nginx nginx nginx

Using mail() causes 504 Gateway Time-out in Nginx


I think the problem in your sendmail. I recommend to install Postfix instead of sendmail and configure it in php.ini. Then check your mail() function.

Also you can try to use sendmail directly instead of using mail- function.


Sounds like a problem with the ability for php to contact the mail server. Have you verified the following:

Iptables is off (or any other firewall for that matter)

Display the contents of the following:

Sendmail cfg

and the output of the following command

netstat -punta (not calling you a name here ;) )