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.

Gravity Forms is awesome, but recent changes at Email Service Providers can block your form notifications.
image-86

Gravity Forms is awesome, but recent changes at Email Service Providers can block your form notifications.

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.

An example:
My website SiteMethodMedia.com is built with WordPress.  The WordPress admin email (Settings>General>E-mail Address) is set to my yahoo email (example@yahoo.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 example@yahoo.com.

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.

The Solutions:

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

  1. Sign into cpanel for the domain of interest.
  2. Click on “Email Authentication” under the Mail header.

    Click on Email Authentication in cpanel to enable SKIM and SPF authentication.
    image-87

    Click on Email Authentication in cpanel to enable SKIM and SPF authentication.

  3. Enable SKIM and SPF in Email Authentication.

    Enable SKIM and SPF email authentication in cpanel.
    image-88

    Enable SKIM and SPF email authentication in cpanel.

  4. Verify the SPF record was created using the Advanced DNS Zone Editor found under the Security header in cpanel.
    Use the Advanced DNS Zone Editor in Cpanel to varify the SPF record.
    image-89

    Use the Advanced DNS Zone Editor in Cpanel to varify the SPF record.

    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:64.91.230.37 ~all.

    SPF record in DNS zone as display in cpanel under Advanced DNS Zone Editor.
    image-90

    SPF record in DNS zone as display in cpanel under Advanced DNS Zone Editor.

     

  5. 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).
    Edit TTL for SPF record in cpanel to publish SPF record sooner.
    image-91

    Edit TTL for SPF record in cpanel to publish SPF record sooner.

    SPF record TTL changed to 300 seconds.
    image-92

    SPF record TTL changed to 300 seconds.

 

2. Change the WordPress Administrative Email to An Email From the Same Domain as the Website.

  1. 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 admin@sitemethodmedia.com or info@sitemethodmedia or whateveryouwant@sitemethodmedia.com — 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.

    Add new domain friendly email in cpanel by clicking on "Email Accounts".
    image-93

    Add new domain friendly email in cpanel by clicking on “Email Accounts”.

  2. Now, use this new domain friendly email for your WordPress email, under: Settings > General >E-mail Address.

    Use an email for WordPress with the same domain as the website to improve email authentication for sent notificiations (Gravity Forms, Contact Form 7, etc.).
    image-94

    Use an email for WordPress with the same domain as the website to improve email authentication for sent notificiations (Gravity Forms, Contact Form 7, etc.).

  3. 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:

    Set up email forwarder using cpanel.
    image-95

    Set up email forwarder using cpanel.

  4. Click on “Forwarders” under the Mail header in cpanel.

    Adding a forwarder in cpanel to forward a domain friendly WordPress Admin email to your everyday email.
    image-96

    Adding a forwarder in cpanel to forward a domain friendly WordPress Admin email to your everyday email.

 

3. Set Your Email Routing to “Automatically Detect Configuration” in Cpanel.

  1. 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”
    Verify email routing by clicking on MX Entry in Cpanel under the Mail header.
    image-97

    Verify email routing by clicking on MX Entry in Cpanel under the Mail header.

    Set mail routing to "Automatic Detection" in Cpanel for most cases.
    image-98

    Set mail routing to “Automatic Detection” in Cpanel for most cases.

 

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…

4 Comments

  1. Pingback: Yahoo Policy Update and Gravity Forms - Red Blue Concepts

  2. Marc McCulloch

    Fantastic post – thank you. We just migrated from a legacy HTML site to WordPress and all of our PHP contact forms “broke.” Our “developer” was at a loss and more or less just left us in the lurch. I picked it up and have been fighting it for several days, UNTIL I FOUND YOUR POST. What was killing me was the fact that I was getting inconsistent results. Sometimes the notifications were getting through, but most of the time not. When I read your post, everything made sense. Sure enough, when I followed your recommendations, everything now works like a charm. You saved me a ton of time and headaches. AND, I don’t need to install a WP-SMTP plugin. Thanks again. Marc McCulloch, http://www.marcarianlaw.com.

Leave a Reply

Your email address will not be published. Required fields are marked *