Very slow email delivery to users

May 29, 2016 521 views
DigitalOcean Apache Configuration Management PHP Ubuntu

I have a registration script that sends the user an email activation link upon successful user registration. From my localhost on my laptop, the email is sent instantly. However, on my Digital Ocean server running Ubuntu it takes 30 minutes to receive this email.

I have this in my code
$mail->Host = "smtp.zoho.com";

I assume this is a server issue. But what needs to be fixed or configured on my server?

2 comments
  • You would need to check the mail logs at smtp.zoho.com if you have access to those. It could be that your sending server is "greylisted" there for some reason. You might be sending funky HELO names or have a mismatched rdns from the smtp servers perspective.

  • Thanks for responding. I thought it could be a zoho issue as well until I tried using gmail instead.

    $mail->Host = "smtp.gmail.com";

    I had the same issue, it still took 30 minutes to send the registration confirmation emails. The weird part is that after hitting the submit button, the loader spins in Chrome and Firefox for 30 minutes. And I can't navigate my site anymore after hitting the 'register' button.

    It's like the site is stuck trying to finish the registration process. So I have to quit the browser and relaunch, then my site works as normal, until I try to do another test registration. But again, all of this works like a charm from my localhost with MAMP.

1 Answer

It could be that DNS is taking a time to find your MX record. So, check your DNS servers.

Have another answer? Share your knowledge.