Contact form 7 Gmail spam fix

Ernest Marcinko Tutorials, Wordpress 14 Comments

Recently I had trouble configuring my contact-form 7 plugin, because all of the email sent from it went to my gmail spam folder.

Luckily there is a very easy workaround for this issue. Usually the contact form configuration looks like this:

cf71

But this is no-go, because the FROM header field will most likely differ from your domain name, and the mail ends up in the spam folder. You can test it with a random email address, but you probably get a similar message in your email header:

Received-SPF: softfail (google.com: domain of transitioning ***@domain.com does not designate X.Y.Z.N as permitted sender)

However I got my SPF MX record configured correctly, I still got a similar error message. Here is a tutorial how to make sure you have the right configuration.

Solution

I figured, if I change the FROM field to match the TO field and add a Reply-to header, it should solve the issue, and it did! All I changed was:

cf72

 

I added the reply-to fields to additional headers:

Reply-to: [your-name] <[your-email]>

Of course you need to change it to your custom form fields, if you have any.

Ernest Marcinko

WordPress developer, javascript enthusiast, photoshop clicker and the founder of wp-dreams.com

Latest posts by Ernest Marcinko (see all)

Comments 14

    1. Post
      Author
  1. Victor

    Followed the above suggestions without success. The mail server is the sending party on behalf of the From address, which still ended up as spam. What did the trick for me was to create a filter in gmail. You can do this from the search-box, click “Create filter with this search” and mark the checkbox “Never send it to Spam”. Simply make the search for something unique from your form, I am using the footer/signature line…

    1. Danny

      Thankyou Victor this solution worked for me. I was thinking of doing something similar but didn’t know how to execute it in Gmail.

  2. Akash

    I think having a proper email format with a proper subject and all other details will do just fine, and it works just fine in my case

  3. Amy

    This was not a bad solution, but I figured out an even better one so that the name comes through in Gmail:

    From: [your-name]

    This way, the name appears on the email when it comes through, and there is no spam issue because Gmail sees that the from address matches the domain it was sent from.

    So glad to have figured this out! Thanks for your help 🙂

  4. Clinton

    With a particular client of mine, the following solutions did not work: Spam/Email Whitelist, Spam/Spam (sender filter bypass).

    Victor’s solution works, but requires that every user create a filter, and using a generic address like “[email protected]” causes all messages to be put into the same thread based on the subject.

    The finally solution that worked, and there was no clue that this was the problem by inspecting the original message headers, was to add the sending server to the list of SMTP relays, under Routing/SMTP Relay Service. In our case, we were using SMTP to send the emails.

    1. Chad

      Clinton, can you explain more about your solution and how it worked. I am running into an issue where contact form 7, which has been fine for years, is no not sending any mail to a gmail address. GoDaddy says something about the headers, similar to what you said, but their solution was to simply change plugins. Any steps you could provide would be very helpful. Thanks!

Leave a Reply

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

Human test *