Fix Contact Form 7 not working with Dreamhost

Tonight my wife asked for my help trying to sort out why a plugin (Contact Form 7) was not working for a website she was working on for a client. Long story short after some trouble shooting it appeared that we were running into an issue where the e-mail address we were forwarding contact form responses to would work with everything but our contact form. Initially following some threads around the web I tried setting up word press to actually use STMP to send e-mails instead of the PHP mail() command as this had helped some people. However, things still were not working. Luckily I found the thread below which lead me to a solution

https://discussion.dreamhost.com/thread-135880.html

The gist of the discussion is that recently Dreamhost decided to cut down on people using shared hosting accounts to send SPAM. We all don’t like spam so I applaud them for taking a stand against the horrible spam (for a quick history of SPAM http://youtu.be/gkBPxfJTjK8).  The issue with Contact Form 7 and their new policy is that most users of Contact Form 7 use a setup like so

However the e-mail will really be sent from wordpress@your_domain.com which violates Dreamhost’s new policy. The reason it violates their policy is that you are technically “spoofing” that person’s e-mail address which is now a no-no so trying to send an e-mail like so will fail. You get around this issue by setting up a new hosted e-mail account on dreamhost to put into the From field in Contact Form 7 and then inserting something into the Additional headers box to allow you to just hit reply and actually reply to the person who used the contact form and not your new From e-mail.

In your Dreamhost CPanel you need to go to your Manage E-mail section by clicking on the left panel button e-mail

Once there you need to

Now this e-mail address you want to treat as if it isn’t going to ever have anything sent to it, you just want to have it there to be able to send e-mail from so you should minimize the inbox size and let it delete any messages that it gets sent even if they are unread. Here is a snapshot of what your settings should look like. Make sure it is a fully hosted address for your domain and that it just removes e-mails without e-mailing you about it.

Once you’ve managed to set up this e-mail you’re going to want to go to your WordPress admin page’s contact form 7 section and edit your contact forms like so. Setting the From field to the e-mail address you just created and then adding into the Additional headers  field the “Reply-To: ” plus whatever contact tag you used to denote the senders e-mail.

 Right now this doesn’t appear to alleviate sending attachment problems. Once I get that figured out I’ll share. Good luck!

You may also like...

10 Responses

  1. nils says:

    thx a lot! saved my day! 🙂
    was about to kill someone… 😀

  2. Paul says:

    I have to commend you on this Fix, I was bashing my head up against a wall trying to work out why it wasn’t working. Your fix even though you found this a couple of years ago is still relevant today. You really would think that this info would be more available.
    Thanks for the great fix.

  3. Trevor says:

    Since i have a custom MX record Dreamhost wont let me create a new email with their services.. Any ideas?

  4. neel says:

    My website is hosted by Dreamhost but my email is with Zoho mail. So, not sure if the instructions you have for the “create new email address” are valid here?

  5. Melinda York says:

    This was driving me insane. I don’t usually use DreamHost and never had this trouble with HostGator. My client already had an account so I had to use it. I tried your solution, which seemed like it should work, but didn’t for me for some reason. What did work was using wordpress@mydomain.com. Thanks for the great tutorial though. Perhaps something changed between now and then. It’s always nice to run across people who are nice enough to take the time to blog about things like this 🙂

  6. Jason says:

    I recently wrote a blog post about this very issue!
    http://www.codingmonkey.ca/contact-form-emails-wont-send-with-my-visitors-email-address/

    It is possible to use your visitor’s address as your From address IF YOUR SMTP PLUGIN supports it. If you’re not using an SMTP plugin, you’re out of luck.

    The trick is to set the Envelope From to the SMTP account email, and the Message From to the visitor email. Now DreamHost will accept your mail. Postman SMTP and WP Mail SMTP both support configuring the Envelope From email address.

Leave a Reply to Jason Cancel reply

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