Contact Form 7 and Anti-Spam

DreamHost has a fairly simple anti-spam policy, which can be summed up as this: You cannot send email from an address that isn’t your domain.

If that was greek to you, don’t worry. What that means is that my WordPress blog here can only send emails as elftest.net. That poses a small problem if you’re not using your domain-name to send email (a rare occurrence in WordPress), and a large one if you happen to be using the popular Contact Form 7 plugin.

Contact Form 7 lets you create robust contact forms for your site, however it has one minor ‘flaw’ (and I hesitate to use that word). When it sends email, it sends it from the user who submits the form. DreamHost, naturally, doesn’t like this. joe@gmail.com isn’t an elftest user!

Thankfully there’s a work-around for you, and it’s really easy. For most people, the plugin SMTP Configure, once installed and activated, will automatically fix this for you! It’s written by a reliable and trusted programmer, and I highly recommend it. Remember! Once you install the plugin, just activate it. For the vast majority of people, this was it. Everything magically worked.

Then there were some people who came and said “No, this does not work.” I’ve yet to reproduce it, but one person told me that after putting in his SMTP credentials, just like you would setting up email clients, it worked perfectly.

Additional: If you’re using Jetpack’s contact form, and you’ve changed the ‘to’ email address, you will also need this plugin. You’ll know you’re using that option because you’ll see this in your contact form shortcode:

to="me@myotherdomain.com"

Comments

  1. says

    somehow it doesn’t work for me. i’ve tried a lot of contact form plugins to see if one would work, all would say email sent, but emails didn’t arrive. yes, i’m trying to use an address that is not @mydomain.com (it’s gmail). thinking smpt configure would work around this, i installed it (first i actually installed WP-Mail-SMTP which didn’t work either and so i deactivated it) and now emails are not sent anymore at all (“Failed to send your message. Please try later or contact the administrator by another method.”)

    any ideas?

    thanks a lot!

    • Ipstenu says

      First change it to an email that IS yours :) Just to make sure that you don’t have another plugin conflicting.

      Remember that it’s the ‘from’ email that has to be yours, not the to.

    • says

      I think this may be out of date. Adding this plugin to a wp install and dream host now makes the form unable to submit with CF7. Still need to make sure the mail is sent from your own domain name.

  2. Alex Hendler says

    Hi, This plug in didn’t work for me either – I clicked “activate” as suggested by the author, then went back to the Contact Form 7 to test it and got this error message:

    “Failed to send your message. Please try later or contact the administrator by another method.”

    Anything I should do in Settings to fix? I’m using DreamHost.

  3. says

    Thanks so much for your help! My client hosts on Dreamhost and we noticed some contact forms were not getting through. I set this up and now everything is working great. But, for me, it wasn’t as simple as just activating the plugin. I had to change some of the default settings (SMTP host and Use SMTPAuth) to get it up and running. Thanks again.

    • Ipstenu says

      I’ve heard that from a couple people, but they’re the minority. I’ve been making note of everyone who has that problem, so I can see if there’s a better fix that we can take care of on the DH side :)

      • says

        I changed the host to mail.mydomainname.com. You would use mail.yourdomainname.com (or whatever your smtp host is). Hope this helps!

  4. Eric says

    I installed this to TRY to get Contact Form 7 working on dreamhost. I use outlook.com as the mail provider and figured out the correct SMTP settings. However, now EVERYTHING from the contact form shows as being “from” the SMTP account used to authenticate. Even using the “replyto” header addition will not show the “from address” that was actually entered with this form.

    Hours spent on something that should work out of the box. Any help appreciated

    • Ipstenu says

      At a guess, you’ve setup CF7 wrong, since you should be able to put anything in the reply to and have that work (even ‘bibbeldy@domain.com’) but that’s something to ask that plugin dev directly.

  5. says

    There is another problem with the whole “Install Configure SMTP, set up to send to a GMAIL, and problem solved!” approach. Gmail doesn’t like to receive emails from Contact Form 7 and will probably lock you out of your own account/make you change your password. This happened to me 3 times before I changed my approach, developed a good work around, and documented it here. Hope it help!
    http://www.directvermont.com/contact-form-7-dreamhost-how-to-fix/

  6. C. Pistofidis says

    I’m hosting a WP site on Dreamhost and Contact Form 7 would not send emails (despite saying it did) for the reasons you explain.

    I did the following to make it work without SMTP:

    1. I created on DH a forward-only address that forwards to my normal email(s)

    2. I set up the CF7 form so that FROM= and TO=

    3. I included the visitor’s email in the message body that CF7 lets me set up.

    Conclusion:
    When a visitor submits a form, I receive an email from . The message has the visitor’s email address in the body, so I can reply to the visitor. The form works, DH is satisfied, no SMTP or other plugins were used. It should work with all kinds of email addresses as the forward-to email is irrelevant.

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>