Configuring Contact Form 7

This post is part of an ongoing series called Ask Jeff. Since writing this article, I have used GravityForms to take care of my contact form needs. Not only is it easy to configure but it’s the plugin choice of many when it comes to contact forms. You can even use it to create a post submission area on your site. Take a look at it and give it a try. This is where I’ll take a question someone within the WPTavern or WordPress community gives me and provide my thoughts/answer to. This weeks question was submitted by Paula.

I installed Contact Form 7. Copied that line of code onto my page. The contact form shows up but nothing comes in to my email box. What am I doing wrong?

Contact Form 7 is one of my favorite plugins because it’s one of those configure and forget type plugins. In this case however, something has gone awry. For starters, I’ll walk you through how to configure this plugin.

Once Contact Form 7 is installed, you can access the plugins settings by browsing to TOOLS – Contact Form 7. Here, you should see a contact form already set in motion at the top of the page. This top box contains the code you’ll need to copy and paste into a page, post, or text widget. It should look similar to this.

But before you can use that form, we’ll need to configure the necessary fields. This is the Form area. On the left hand side is a text area containing the HTML as well as the shotcodes for your contact form. On the right, you should see a Generate Tag drop down button. When you click this, you have a bunch of options to choose from regarding fields. For instance, you can add a drop-down menu, radio buttons, checkboxes, CAPTCHA, file upload, etc. Here is my contact form already configured on the left with a look at the tag generator on the right.

Once we have the form put together, we’ll need to configure the Mail options so when someone submits a form, it will be sent to our inbox. The TO: field at the top is the email address where submitted forms will be sent to. The from box is simply the form fields that were filled out and the subject area provides you with the opportunity to create a custom message header which I have done in the following screenshot so that I can create a custom email filter for Thunderbird. Also, this lets me know that a message was sent from the WPTavern website.

Last but not least, you can configure the actual messages end users will see when they perform an action. For example, if the message fails to be sent, they will see the message corresponding to that event.

Once you’re finished with that, click the save button and you’re ready to create a new page where you can add your contact form shortcode via the HTML tab in the post editor which will display your contact form on the page.

In the end, if emails are not being sent to your inbox through your contact form, double check your mail settings to make sure you didn’t put in a typo with your email address. Secondly, make sure your using spam filters to allow emails to be accepted from your domain. Last but not least, it could be the Subject Line that you configured which is telling your email software that the message is spam. Configure your software to allow for that subject line if need be.

Submit Your Question:

If you have a question regarding any aspect of WordPress you would like me to answer or at least, hear my take on, you can either contact me using the following contact form with your question or you can follow WPTavern on Twitter and send me an @reply with your question. If the WPTavern account is following you, simply send me a Direct Message with your question. Don’t expect expert opinions or answers as I’m not an expert

Something Better:

Since writing this article, I’ve ditched using Contact Form 7 in favor of a commercial plugin called Gravity Forms which is awesome and easy to configure. Take a look at it and give it a spin.

Who is Jeff Chandler

Jeff Chandler is a WordPress guy in the buckeye state. Contributing writer for WPTavern. Have been writing about WordPress since 2007. Host of the WordPress Weekly Podcast.

@Kel – Yeah, that is true. I didn’t mention this in the post but surprisingly, I’ve had very little spam arrive in my inbox through my sites contact form. Maybe the simple captcha configuration I use is enough :)

Hi,
I am trying to set up Contact Form 7 and although I get the message, the email from the sender does not appear so if I would like to contact that person again, I have no way of doing so. My form can be seen here:

@Julio – Hmm, well if your form is asking for the end users email address, it should definitely be part of the email that is sent to your inbox. When you view the email message that is sent to you via the contact form, what does it say in terms of the “Sent by” address?

How exactly can I add a checkbox that is already checked when the contact form loads and adds the email address to a email newsletter database I created? Can anyone help me out? Been trying to figure this out all day!

What if you want to use contact form to send email to more than one person? such as a real estate website with multiple agents. how do you make sure that the correct agent is getting the e-mail, say regarding his or her property listing?

First of all I a novice with this so my question maybe a bit silly….pls bear with me :)
I just added contact form 7 to my site and I would like to change the ‘click here to send’ into a button. How can I make that change? Would you be able to assist me with that?
BTW just found your site and am enjoying and learning a lot.
Regards,
Heguiberto

Is there a way of displaying the error / thankyou messages centrally both vertically and horizontally – currently if a user has a validation error the message is displayed right at the bottom of the page – the user might not see it!

Jeff,
I have contact form 7 up and running. When I do a test, it send the email and I receive it but it’s from noreply@myurl. So this prevents me from even reply to the person trying to contact me. Any idea why this is?

I have the contact form in which i have a dropdown menu for the states. I was able to make my other fields mandatory, but I was not able to make the state field mandatory..can anyone please tell me where to put the ‘*” mark in this code, to make the dropdown menu of states mandatory…please help thank you in advance…

I love Contact Form 7 and am actually using it to run a survey from my page, which has been very helpful!

I know you mentioned in the article that you are not the author, however I am pretty sure my question is a super simple one and can probably be answered by someone here.

I have configured the checkboxes into yes or no questions. However, when people fill out the contact form, their yes or no answer is not showing up. In the message body section of the form, my checkbox tag looks like this: [Are-you-a-high-school-or-college-student “Yes” “No”]

However, it comes through in the e-mail looking like this: [Are-you-a-high-school-or-college-student “Yes” “No”] — instead of as a simple yes or no answer, which would correlate with the box they checked.

Jeff,
I have contact form 7 up and running. When I do a test, it send the email and I receive it but it’s from noreply@myurl. So this prevents me from even reply to the person trying to contact me. Any idea why this is?

I too love Contact Form 7. I wish it had better captcha integration but I just use the 1+1=? question. In any case it sure beats having to hand code forms.

One thing I like to do with this plugin is to use it for “refer website to a friend” button. I configure it so it sends email to the friend and it send me the info on who sent the referral to whom and what they said. This way is the referral calls me I already know some background information based on who shared my site with them.

I am trying to set up a form that includes a set of radio buttons. I want to have one of the buttons already selected when the page loads. Is there any way to accomplish this? It would be much easier than having to force people to choose a radio button every time…

@Adam – I’m having a similar problem except I get the email correctly. However, when I click on reply (using Gmail), the “To:” field gets filled with noreply@sitedomain.com. Is there a way to make it so the email of the sender gets filled in that field instead of the noreply?

Thanks for your reply. I read the description of that plugin and it looks like it allows you to set the “From” line for emails which actually isn’t a problem for me. The emails arrive ok with the “From” field filled out correctly. However, when I click reply, the “To” field gets changed to noreply@sitedomain.com. I’m wondering if that plugin will take care of the problem for me even though I didn’t read any mention of it in the description.

Im using contact form 7 with email drop down option as
[checkbox* departments
“Department name1|department1@test.com”
“Department name2|department2@test.com”
“Department Name3|department3@test.com”]
and generating an auto response from it as :”Your email has been received to the [departments] department.”
I need department name to appear instead of email address, Like Department name2 instead of department2@test.com.
please help!.

Hi – Not sure if anyone can help me but I have the contact form all ready to go and I am getting the emails just fine. I have a file upload on my form and this is what I have.

This is what I currently have:Form: [file* yourfile]
Mail: [yourfile]
Body: [yourfile]

Also I can get into the temp folder and I see the file there….so it’s just not getting sent to my email (but I am receiving the email just without the file attached.) I had it working earlier – so I know it does work but I am not sure what changed…hmmm. I have also checked out the plug-in site help but I don’t know what I am doing wrong and their comments are close. Hoping for an answer! Thanks for any help!

This plugin is very hokey! Works on some accounts and not others. It’s sending my client nothing. So he loses his emails from customers. So we will have to code out a form from scratch because at least we know it will work. I am sure that there are other form generators out there for wordpress but I don’t feel like searching, installing, and testing plugins. Just easier to code it from scratch since 99.9% of all plugin developers don’t provide a demo. WTF?