Contact Form 7 (CF7) is one of the most popular WordPress plugin. As the simplest online contact form solution, it is also included in many commercial themes. But when online form doesn’t send out email, or website owner can’t receive email, we need a solution and we want it fixed ASAP.
Most of the issues share the same symptom, no incoming email. To troubleshoot, there are many things on the check list to start with. In my experience, most common online contact form issues are actually not problem with WordPress / PHP, but related with the email service offered by hosting company.
ISSUE #1: Email is treated as junk-mail
If the email sent out by the online contact form is constantly landed in junk-mail box, you should consider to make the email looks NOT like a spam. It is actually pretty common to see this kind of CF7 email template:
From: [your-name] Email: [your-email] Message: [your-message] ---- This e-mail was sent from a contact form on (http://domain.com)
When visitor don’t write much at message box, this email looks more like a spam.
Solution: Lengthen the email body.
How to stretch the email body and get it pass the junk-mail filter is a trail and fail process. In my practice, I found making [your-message] a required field with minimum length requirement helps.
ISSUE #2: Email subject is missing
In older version of CF7, the filed [your-subject] is used as email subject. But in most contact forms (I worked with), [your-subject] is not required field. In case visitor submit the form without filling up [your-subject] filed, the email will be sent out with blank subject. This again is easily to make the email being treated as spam and not even being delivered at the server-side.
Configuration Validator was introduced since CF7 version 4.4. It gives warning message on email template using only [your-subject] as email subject. Here is a detailed explanation on this issue – There is a possible empty field.
Solution: Use static text as subject.
We can move the subject into email body and use static content as subject. E.g., “Online contact request from your.website.com”.
ISSUE #3: Email sender is rejected
This issue is fairly common. The cause is email address used as sender’s email address does not belong to the same domain. For example: the website is mycompany.com, but in contact form email template, email@example.com is used as sender’s email address.
In case like this, when form is submitted, it is highly possible that relaying mail servers consider it as a spoofed address. Only when using email with same domain address, we reduce the risk of being treated like that.
Solution: Use a same domain email.
In most case, I simply use firstname.lastname@example.org as sender’s email address. In some extreme case (on server with tougher rules), sender’s email must be existing. We can create a real email address just for this purpose. Or even better, use a real email address such as email@example.com.
Troubleshooting email delivery issue requires more knowledge other than HTML & PHP. In case you can’t figure it out the cause after validating CF7 settings, asking for help from hosting service provider should be considered as a second step. After all, as mentioned at beginning, most contact form issue is email delivery issue.