wordpressgmailcontact-form-7email-spam

Contact Form 7 mails are being marked like spam


All the mails sent from a Contact Form 7 form are being marked by gmail as spam.

A hint: I looked at the option "Show Original" and I found stuff like this:

Return-Path: <www-data@localhost>
....
Received-SPF: none (google.com: www-data@localhost does not designate permitted sender hosts) client-ip=178.216.103.114;
....
Authentication-Results: mx.google.com;
   spf=neutral (google.com: www-data@localhost does not designate permitted sender hosts) smtp.mail=www-data@localhost;
   dmarc=fail (p=NONE dis=NONE) header.from=gmail.com

See all thos www-data@localhost ? My guess is that they have something to do with the problem (but I could be wrong).

What could I do to solve this problem on the server side?


Solution

  • This is a common issue with Contact Form 7 and some php mail or server settings on some hosts.

    Try hardcoding the sender name in the ‘From:’ field in the ‘Mail’ section like Webmail <a-valid-address@mydomain.com> This means you won't see the sender name or email as names and return emails in your incoming mail box, but that doesn't matter much, as the sender's email will be in the body of the message.

    If that doesn't work, try https://wordpress.org/plugins/wp-mail-smtp/ to use SMTP instead of php mail.

    And see http://contactform7.com/faq/ and http://buzztone.com.au/contact-form-7-email-issues/