Troubleshooting Email Issues on WordPress

I was posting in the WordPress forum earlier this week, when I decided to do my civic duty and actually try to help out some of the people posting their own issues. This post caught my attention – and sympathy:

All my emails from my website’s contact page are forwarded straight into my Google spam folder. I have installed the WP Mail SMTP plugin and watched a few videos, but I am still confused.

Why Doesn’t My Form Work?

In the 14+ years that I’ve been building websites using WordPress, a non-working form has probably been the most pernicious and sticky issue to troubleshoot. It’s one that can result in disproportionate panic, with some clients claiming they lose thousands of dollars for every single lead that they don’t immediately receive. Even if WordPress isn’t the problem, and you don’t have access to resolve the problem, you’ll still be held accountable for the problem. For some people, the web developer of the website is just in charge of the Internet in general.

If you’re extremely unlucky, you’ll wind up on conference calls with an angry, cursing client and their inexperienced email IT tech who insists your form must be broken, but who is also so unfamiliar with DNS that they don’t know how to perform a WHOIS search. (Not that I’m saying this has happened to me.)

Troubleshooting A Broken Form

I tried several times to write a wiki article for my coworkers detailing how to handle this issue, but it was just too big. Too many possible causes, too many possible solutions. But there are definitely a few common problems that you might be able to resolve, even without access to the hosting server, email, or DNS.

Check Your Form Settings

The first thing you should always do – ideally before even launching the form – is verify that your form is set up correctly. This may change depending on which form plugin you’re using, but most of them will have the following fields:

Email To

Make sure this is correct and has no typos. You’d be surprised how often this simply didn’t get filled out by someone setting up the form.

Email From

Never use a “From” email address that doesn’t match your website domain or your SMTP plugin. And especially don’t use the email address entered by your lead. I like to use no-reply@mydomain.com. You can use your own email address, as long as it meets the above criteria. This is actually really important, and I’ll explain why later.

Email Subject

Use variables if possible, and don’t use a short subject like “New Contact.” The subject of the notification email doesn’t seem like something that would matter, but it’s more likely to be rejected as spam by the incoming mail server if it has a short, generic name. If you have a form plugin that allows variables, try adding the sender’s name to it.

Message Body

Make the email itself longer, and have custom data. Sometimes email providers “helpfully” flag emails as spam if they all look the same. That means you can’t just send yourself a short notice like “You have new messages.” It needs to include the form submission details, the URL where the form was submitted, etc.

Notification Settings

Form plugins like Gravity Forms will allow you to create multiple notifications. For example, you might have an email that goes to you, and another one that goes to the person who just submitted the form. Make sure the notifications are actually turned on and activated.

Test The Form Yourself

If you’re using a plugin, in my experience this is uncommon, but the form itself might be broken on the front end. Here’s the testing procedure I follow:

  1. Check form settings as above, but replace the “To” email with your own email. It’s especially helpful if you use an email address that isn’t on the same domain as the client’s email address.
  2. Turn off Akismet, or any other plugins that might be filtering spam – sometimes these plugins block “test” form submissions.
  3. Install a plugin like WP Mail Logging (or turn on logging in your plugin, if it’s offered) and activate it.
  4. Go to the form on the front end of the website. Open the browser inspector so you can watch for JavaScript errors. Fill out everything with obvious dummy text – something that the client would recognize as a test submission from you, if they receive it. Submit the form.
  5. Check if you received the email in your own inbox. If you did, then you know the form works and the issue is likely with the other email address, or with the spam plugins you just turned off.
  6. If you don’t receive it, read through any error logs or JavaScript errors on the page for an explanation of why the form isn’t working.

Install An SMTP Plugin

When WordPress sends email, it uses a PHP function called mail(). Using this function can be a problem. Some web hosts limit the number of emails that can be sent using PHP mail(). It means all email comes from your web hostIP address, which might have a bad reputation (more on that below). And it also sends unauthenticated emails, which some email servers reject automatically.

Plugins like Post SMTP solve this by sending your emails through authentication. You’ll need to set it up with an email address that you can authenticate with, such as a Gmail address, a dedicated Microsoft 365 email address, or a Sendgrid account.

Some clients consider this type of solution a “band-aid”, and I’ll admit that I don’t love having to use it. I’d rather fix the surrounding issues, and in my experience, you nearly never need to use this plugin unless there’s something well and truly broken somewhere. It also means you have to create a potentially expensive SMTP account on a service like Sendgrid (which has pricing based on the number of emails sent monthly) or a dummy email address (which will slowly fill up with every single email sent through your forms). Plus, if the plugin is ever accidentally deactivated (and I’ve had this happen), suddenly the forms stop working.

That being said, this is often the easiest and most direct solution, especially if you don’t have access to fix the below issues.

Check If Your Hosting is Blacklisted

If your website is on any kind of shared hosting plan, especially on cheap providers like HostGator, Bluehost, or GoDaddy, it’s probably on a hosting server with hundreds or even thousands of other websites. It’s possible that one of those other websites was sending a lot of spam, using the same server and IP address that your website form is using now. If enough people flag emails from a server as spam, that server is going to get blacklisted.

You can find out if your hosting is blacklisted by visiting https://mxtoolbox.com/blacklists.aspx. You’ll need to enter in your domain name, or the IP address of your host server. If you find out that you’re blacklisted, this could be why your form submissions aren’t getting anywhere, or why they’re being flagged as spam. You’ll need to try to get removed from the blacklist.

In the meantime, you can “whitelist” your form submissions in your email account. This won’t feel like a real win, but it might be a good solution until you can at least try to fix the blacklisting.

Fix Your DNS Issues

Earlier I said that your “From” email address field needs to be using the same domain as your website, or the SMTP plugin you’re using. This is because of how DNS works, and how email spam filters decide whether or not an email is valid.

If you view the headers of a spam email, you’ll see that they usually have a “From” email address that doesn’t match the actual sending server. For example, I just checked my spam folder and found a phishing email claiming to be from Amazon Prime. It claims it’s sending from “info@Prime.com”. However, the actual email server was something completely different. That’s a dead giveaway that an email is junk, and spam filters usually block them.

If you use someuserat@gmail.com as the “From” email address, but you’re sending the email from somedomain.com, any decent spam filter will block your form submission as likely spam.

This can also happen if you’re using your website domain as your email address, but the website is hosted in a completely different place than your email is. For example, if you’re using GoDaddy to host your website, but you’re using Microsoft 365 to host your email, then your website can’t send emails without tripping up spam filters. Even though they’re the same domain, only the Microsoft 365 email server has the right to send email from that domain.

If you’re familiar enough with DNS to do this, you can usually resolve this issue by adding an SPF entry to your DNS. This tells any server checking that yes, your website has permission to send email too.

Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments