WordPress Notification Emails Not Working (Gravity Forms)
Problem: Gravity Forms, Contact Form 7 and Other WordPress Email Notifications Not Arriving
When I was recently setting up some Gravity Forms contact forms for a few websites, I ran into a big problem. Email notifications were being sent, but not received. Interestingly, it seemed to be more of a problem with yahoo email vs. gmail.
I did some investigation online and at the support threads at Gravity Forms without much help.
I then looked at the email logs on the server through WHM and found the problem. My sent emails were being rejected by Yahoo for inadequate email authentication.
Now what? (Reading, swearing, more reading…)
As it turns out, Yahoo! recently implemented some fairly strict authentication policies for its email services. Emails not meeting these criteria are rejected and not delivered.
When I tested the notifications with a gmail email they worked, but with a warning: “This message may not have been sent by:…” The gmail warnings made me think that Google was concerned about the email too.
So what was it?
Turns out is was two problems with email authentication and Yahoo’s new, strict email authentication requirements were rejecting the emails sent from the contact form. Gmail also had issues with the emails, but accepted them after adding a warning to them. The problems:
The first problem: DKIM and SPF authentication were not set up on the servers that were sending the emails.
The second problem: Emails were sent from a domain different from the “claimed” email domain. That is, the emails being sent were labeled as from the email set in the WordPress settings for the site, but coming from the domain of the website, and in my case, these two domains did not match.
My website SiteMethodMedia.com is built with WordPress. The WordPress admin email (Settings>General>E-mail Address) is set to my yahoo email (email@example.com). When my site sends out a notification email via WordPress the receiving Email Services Provider gets an email sent from my website SiteMethodMedia.com that says it’s from firstname.lastname@example.org.
This sends up red flags at the Email Services Provider that this email claims to be from one domain but is coming from another — a commonly used spam technique.
So, two problems. 1) DKIM and SPF email authentication not set up and 2) Email and website domain inconsistency.
1. Set up Email DKIM and SPF Authentication on your server.
I use cpanel to manage my servers. Here’s what to do in cpanel
- Sign into cpanel for the domain of interest.
- Click on “Email Authentication” under the Mail header.
- Enable SKIM and SPF in Email Authentication.
- Verify the SPF record was created using the Advanced DNS Zone Editor found under the Security header in cpanel.
Click on the Adanced DNS Zone Editor which should display a list of DNS records. Look down the list to make sure a SPF record (TXT record use to set it) exists. It should look something like this:
sitemethodmedia.com 14400 IN TXT v=spf1 +a +mx +ip4:184.108.40.206 ~all.
- Edit the SPF record to speed the updating of the DNS record. When DNS records are changed, a “Time To Live” value is applied to the record. This tells the server when to “publish” the record and make it available to the world wide web. The TTL values for DNS records are in seconds and often default to higher values (longer delay until the record is published), many are 14400 (4 hours).To make the SPF record “live” sooner, change this valve. I use 300 (5 minutes). Do this by clicking on the Advanced DNS Zone Editor (as above), find the TXT SPF record, click on the “Edit” link at the end and change the TTL to 300 (or some value in seconds).
2. Change the WordPress Administrative Email to An Email From the Same Domain as the Website.
- Email Service Providers may flag emails that do not match the domain they are sent from as spam. Fix this by using an email with the same domain as your website.Example: If you have a website sitemethodmedia.com, create a new email, like email@example.com or info@sitemethodmedia or firstname.lastname@example.org — basically any email using the same domain as the website. First, create the the new email. In cpanel, click on Email Accounts to create a new email.
- Now, use this new domain friendly email for your WordPress email, under: Settings > General >E-mail Address.
- To get these emails to your everyday email, simply set up an email forwarder from the above domain friendly email to your everyday email. This can be done on cpanel as follows:
- Click on “Forwarders” under the Mail header in cpanel.
3. Set Your Email Routing to “Automatically Detect Configuration” in Cpanel.
- Email routing settings are defined by MX (mail exchange) DNS records on the server. These records define mail routing for the domain. These need to be in place and correct for email to work for the domain. Much of this is done by the server when the account is set up. For most cases, email the email routing setting in cpanel should be set to “Automatically Detect Configuration”
And that’s it. Your Gravity Forms notifications, or Contact Form 7 or any other email sent from WordPress should now work. I hope this helps…