I noticed all of a sudden that any operation that has to do with sending email on my site returns with 504 server timeout page. Fortunately, the email gets sent but returns a 504 error. I went further to create a php script in the root of my application just to send email
<?php
try{
mail('name@email.com', 'Testing Magento mail', 'Hello user. Did you get the mail?');
echo 'Mail sent';
}catch(Exception $e){
echo $e->getMessage();
}
but got the same effect of timeout. Mails were going fine prior to today and nothing was changed on the server. What could be wrong?
Asked
Active
Viewed 879 times
0

Kunsal Ajay
- 101
- 2
-
1How did you configure PHP to send mail? – Michael Hampton Oct 24 '18 at 17:52
-
`sendmail_path = "/usr/sbin/sendmail -t -i"` – Kunsal Ajay Oct 24 '18 at 18:48
1 Answers
0
Yes I solved the issue. It has to do with the way my etc/hosts
file was configured. I added this line to it.
127.0.0.1 myServername myServername.localdomain
and it worked.

Kunsal Ajay
- 101
- 2