management job interview questions

Form Madness – Why won’t my contact form email…

Can’t email yourself from a contact form plugin?

Here’s the problem – the contact form you set up in WordPress with either Contact Form 7, Ninja Forms, Gravity Forms, or any of the millions of other contact form makers won’t send you notifications of a form completion. Well, it is, but you aren’t getting them.

That’s the frustrating part – there’s no errors from the sending end but it never shows up in your inbox, nor your spam box, nor the quarantine box, it just doesn’t get there. What the heck is going on?

sign about email problems and fixes to formsFirst off, here’s the actual problem: you’re trying to send yourself a form completion email but you are really sending yourself an email notification NOT from your normal email server, it’s coming from the WordPress email functions that use the servers email settings which WordPress is installed on. Those servers are then trying to send the email with your domain name using their own domain name, a big no-no as it really looks like your email has been hijacked and is being used by hackers for nefarious purposes. Most email servers see this as a big red DANGER DANGER flag and will completely block it from entering their system – it never makes it to YOUR email system, as your email server stops it cold. I’ve seen this in Gmail, Outlook, and others, and typically we’ve done a workaround like sending to a personal email or different corporate account.

Now, after many frustrating searches for a fix, I came across what was really happening as described above. It’s hard to diagnosis a problem without any errors being generated or visible symptoms. And the fix is stupidly easy once you realize what’s going on. And since it’s only a problem when the TO field matches who it’s FROM it may be intermittent as you set up sites and forms for clients.

Here’s a fix to web forms that aren’t working in WordPress:

Match your MX records in cPanel for that domain to the ones you’re are using for the email service of that domain. Normally, these settings don’t matter as the email service is a different provider as indicated in the domain name DNS settings (which take precedence) BUT in this special case, it does, as you are using the site hosting server to send the email. Confusing? Sorry, that’s the clearest I can explain it.

So, for example, if your email is running through Gmail, in your site hosting cpanel, go to the Zone Editor function, select your domain, and add the Gmail MX records. Provided below.

Values for G Suite MX records

Name/Host/Alias Time to Live (TTL*) Record Type Priority Value/Answer/Destination
@ or leave blank 3600 MX 1 ASPMX.L.GOOGLE.COM
@ or leave blank 3600 MX 5 ALT1.ASPMX.L.GOOGLE.COM
@ or leave blank 3600 MX 5 ALT2.ASPMX.L.GOOGLE.COM
@ or leave blank 3600 MX 10 ALT3.ASPMX.L.GOOGLE.COM
@ or leave blank 3600 MX 10 ALT4.ASPMX.L.GOOGLE.COM

That way, your hosting server passes the email function to where it really belongs, back with Gmail.

In theory, it should work with any email MX records that aren’t on your site host that you want to use for a form where the to and from addresses are the same. I haven’t tried it using others though, only Gmail. This problem IS NOT documented in Contact Form 7, Gravity Forms, or Ninja Forms – at least that I could find anyway.

Hope that helps someone, any questions, leave me a comment.

I’ve probably not done my best to describe this problem but, you know, English is a stupid language.

Leave a Reply

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