WordPress mail going to spam folder after moving to Digital Ocean from Godaddy

WordPress site mails going to spam folder after moving from GoDaddy shared hosting to Digital Ocean (still using CloudFlare). Currently I’m hosting 3 websites in 1 droplet… But all the PHP mail are sent to spam folder…

Here is my cloudflare DNS settings of my primary website.

My domain provider is and those MX settings are for BigRock email that I access from

When I was in GoDaddy shared hosting, it was working as expected… but not now…

How fix this? so that emails sent from any one my domains of the droplet do not go to spam folder…

Thank you…

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.


GoDaddy uses cPanel last I recall, so their servers have a functional mail server already installed and setup. When an e-mail is sent from your domain on their servers, it can be validated.

When you send e-mail from your Droplet that may not have a functional e-mail server setup to validate outgoing mail, it lands in junk/spam as the receiving server can’t verify that it’s being sent from the intended sender/domain(s)/host.

WordPress, without a plugin, sends mail using PHP’s mail() function which doesn’t validate what’s being sent, or who’s sending it. It sends what you tell it, when you tell it.

There’s two ways to fix that. The first would be to setup a working mail server on your Droplet and go through the process of setting up Postfix, SPF, DKIM, DMARC, and PTR (Reverse DNS).

If you go this route, this will get you started, but it’s not all-inclusive and there’s still much of what I noted above that needs to be installed and configured beyond what this guide details:

The second and, in my opinion, better method would be to use a transactional e-mail provider such as SparkPost, SendGrid, or Mailgun (all of which have WordPress plugins to integrate with their API).

Using the above, you’re not managing a mail server on your own (which can be a major pain, if you’re not sure what you’re doing) and SparkPost allows you to send up to 100,000 e-mails per month, which should fit most users needs.