Contact Form 7 + Bluehost + Google Apps

When the webdev gods are especially tougher on you more than usual

When the webdev gods are especially tougher on you more than usual

In rebuilding my site, I ran into some issues with Contact Form 7 and not receiving test emails. It was one of those lovely moments at the end of my deving day when I thought to myself, "Ooh, I'll just finish up by testing the contact form so I can cross the 'Contact' Page off as 'done' — that will be an easy gimme."

Not. :(

Identifying the Problem

I've used Contact Form 7 for many years and never had issues. This time, I wasn't receiving several test emails. I've been out of the game for a while so I was thinking it might have been conflicting with the theme? Jetpack's contact form? funky variable issues with the form settings?

First step, I figured it was something wrong with the configuration of CF7. There are often server-side issues with the "FROM" address coming from outside/non-local email addresses, that is, your server may believe that a sender's address is spam and will filter it out. Additional headers should be entered, etc. — instructions below. I tried tweaking several settings to no avail.

One of the things I did right off the bat was change the "FROM" values from [senders-email] to a real, existing email address I have for This way, my server will not flag visitors' emails as 'stranger danger.' (Contact Form 7 "Your message was sent successfully." but not receiving emails)

I kept refreshing my Gmail, checked my spam folders, anywhere else the emails could have gotten lost. No avail after several tests, changing one CF7 variable per test. I was still successfully receiving emails sent manually, just not from CF7. Wtf.

Logging onto Bluehost cPanel, I check to see how the email account was configured and checked the webmail just in case. HA! FOUND YA!

Gaiz. Where are we?  (LOST s02e23)

Gaiz. Where are we? (LOST s02e23)

Turns out my test emails were sending just fine (if CF7 says that the message was sent successfully, then it is indeed sending properly.) All 17 (lol) of my test emails were sitting in my webmail box. There was a problem with the hosting --> Gmail/Google apps portion.

I have my domain email setup with Google apps, which involves how my webmail uses Gmail MX Entry configurations.

Because I set the "FROM" to my own email, the server believed that it is sending an email to itself and the webmail will then send the mail locally. That's the reason my test emails were stuck in the webmailbox (Can't receive mail from a web form). I had to configure it so that my email would process these emails remotely rather than locally.

How to Fix Contact Form 7 --> Bluehost --> Google Apps

This is how I configured the Contact Form 7 settings:

contact form 7 settings

contact form 7 settings

Then, on the cPanel/Bluehost end:

  • Go to cPanel
  • Click on MX Entry
  • Select your domain
  • Go down to MX Mail Exchanger
  • Select Remote Mail Exchanger

After I did this, I was able to successfully receive my test messages in my Gmail/Google apps inbox. w00t! (They no longer appeared in my webmailbox because they were successfully sent out! No more stuckness, yay!)

These articles were extremely helpful for problem-solving this issue: