Have you been receiving “This email address does not belong to the same domain as the site” error on your Contact Form 7? Let us help you fix it.
Contact Form 7 error “This email address does not belong to the same domain as the site” is related to your email configuration. You generally see this error message if you use an email address that’s not associated with the site where you’re running the form. The plugin runs an email validation check to ensure that the email address being used is associated with the domain that the site is running on.
In this short post, we’ll explain a few ways to deal with this error, including bypassing it.
How to fix “This email address does not belong to the same domain as the site” error
Before you look for solutions, keep in mind that seeing this error doesn’t necessarily mean you’ll stop receiving emails. However, it’s best to resolve the error early to avoid issues with authentication and messaging in the future.
Depending on your preferences, here’s what you can do to fix the error:
1. Change the email address in your settings
You can fix the error by ensuring that the email address in the “From” field in your Contact Form 7 settings uses the same domain as your website. For example, if your site is xyz.com, your email should be something like info@xyz.com. To change the settings:
Step 1. Click the Contact tab on your WordPress Dashboard. You’ll see a list of forms where you can find the contact form causing errors.
Step 2. Hover over the form with the error and you’ll see two options: Edit and Duplicate. Click on Edit.
Step 3. On the settings click the Mail tab.
Step 4. Change your email address in the Form field.
2. Use an SMTP Plugin
An SMTP plugin like WP Mail SMTP can help ensure that the emails are sent correctly. It can also bypass the issue, meaning you can use an email from a different domain without receiving the error message. To install a SMTP plugin:
- Go to Plugins on your WordPress dashboard.
- Search for your preferred SMTP plugin.
- Install and activate the plugin.
3. Edit the contact form 7 code to bypass the restriction
If you absolutely must use an email address from a different domain, you can bypass this restriction by editing the Contact Form 7 code. This is generally not recommended as it could lead to other email delivery problems, and it’s usually best to keep the email address within the same domain as your site. Nevertheless, if you choose to use this method, here are the steps:
- Find the file that generates the error message. It’s usually in the plugin folder contact-form-7/includes/config-validator.php
- Locate the following lines of code
case self::error_email_not_in_site_domain:
return __( “This email address does not belong to the same domain as the site.”, ‘contact-form-7’ );
- Put two forward slashes in front of each line to disable the error. It should look like this:
//case self::error_email_not_in_site_domain:
//return __( “This email address does not belong to the same domain as the site.”, ‘contact-form-7’ );
4. Update or reinstall the Plugin
Sometimes issues like this can be solved by simply updating the plugin to the latest version, or by deactivating and reactivating it. If that doesn’t work, you may want to consider uninstalling and reinstalling the plugin.
5. Inspect email configuration of your hosting
Some web hosts have specific requirements regarding the email addresses that can be used with a given domain. Check your host’s documentation or contact their support for information that might be causing this error.
Final words
The error is likely an intentional part of the plugin’s design, and it’s usually best to comply with the expected configuration rather than trying to work around it. If you use an email address from the same domain as your site, it can help ensure that emails are delivered correctly and don’t get flagged as spam.
Hope this helps solve your issue!