Pages

Thursday, August 1, 2013

How to send emails in Wordpress with Contact Form 7

Recently I was working with a client's Wordpress-based site where they had configured a contact form using Contact Form 7 to send emails to clients. I'm not going to enter in details on how to use Contact Form 7 since there are good guides in the plugin's site.

The thing is that after configuring Contact Form 7, I found issues sending emails. The Contact Form 7 owner posted a link to a blog that explained how to solve this for specific configurations using WP-Mail-SMTP plugin. This gave some guidance but I had to tweak it a lot (for example, changing from WP-Mail-SMTP to WP-SMTP) to make it work for me, and I hope with the following instructions you will be able to solve it in your site too.

First of all, my configurations:

Wordpress, version 3.5.2

Contact Form 7, version 3.4.2

WP-SMTP, version 1.1.5

The site is hosted in GoDaddy.

Notice that I use WP-SMTP instead of WP-Mail-SMTP.

First, you have to change the WP-SMTP configuration. You can do it through Settings -> WP-SMTP. Set the following:From: my email (ex: "asdf@gmail.com")From Name: "Whatever you like"Host: localhostSMTP Secure: NonePort: 25SMTP Authentication: No
All the other fields empty.

WP-SMTP Configuration

You should be able to send a test email using the fields at the bottom of the form. If this works, you're almost done!

Finally, another problem that I found is that you cannot send empty message body in the Contact Form (notice the [your-message] value in the picture below). Based on the Contact Form Docs, I configured the contact form as shown. The field [email-88] is the name of the field email that the user introduced in the form.

First available with WordPress Edition 2.8, this design tag profits the information of a tag. A tag ID can be approved as a parameter, but if no tag ID is approved, the information present queried tag will be came back.Because WordPress connections with this data source by itself, you as an end customer, shouldn't have to fear much about its framework.