Blog

How to troubleshoot email sending by WordPress

Email delivery is always an issue, it’s not just WordPress, it’s pretty common problem for websites on a shared hosting accounts. Here are a couple of steps to troubleshoot your email delivery.

One common issue of the shared hosting accounts is that email is sent from random network IP address of the service provider and it get’s filtered out on a receiving end because some mail DNS records are not setup correctly.

I am referring to DMARC, DKIM and SPF records. Those are basically records setup in your domain zone file (DNS) which share info from where your emails can be sent. The idea behind this is to catch sender’s email spoofing.

So, here is a simple trick to test your records.

Send a test email using your WordPress form to a gmail account. Create one if you don’t have, it’s free. We will use it for testing.

Once email is received (check spam folder as well), let’s use “View original” feature:

Once on the View original page, gmail will show you important info which may show some issues with DNS setup for your domain, here is an example:

Here, gmail is saying that SPF record was not setup correctly and that means your message will likely be delivered to spam folders or just rejected by mail servers.

Solution: check your WordPress hosting provider website for mail setup – don’t use IP address you found in gmail, sometimes that address is not constant and may change. Most providers will tell you to add `include:theirdomain.com` to your SPF record to make all outgoing email work. Just google your provider’s name and SPF and you will likely see a knowledgebase article or support forum post with instructions.

Andrei Filonov

I believe in custom built WordPress themes tailored for specific website needs and the beauty of handcrafted code with minimalistic use of plugins for everything.
I help WordPress developers to learn how to build custom WordPress themes and earn a great freelance income to support the lifestyle they deserved.