Emails from my contact form are not arriving in Google Workspace
When a customer makes a booking, submits a form, or purchases a product on your website you need to be notified. You need to ensure that these emails arrive in your inbox but you may find that they are going missing in Gmail.
There are a lot of reasons why this doesn't happen, so first, you must ensure they are leaving your WordPress site correctly and then ensure that Google Workspace receives the email correctly on arrival, and knows it's legitimate.
Most of these issues are resolved at the sender end, so let's dive in to how to do this.
Do I have to worry about this?
Clients on our Managed WordPress Website Hosting don't have to worry about all this, as we configure it at no charge during your website setup. Emails will be forced to a from address of no-reply@yourdomain.com and we validate your domain. If you wish to make the email easy to reply to, then user the "Reply-To" header or setting in your form email configuration to enter the users email address (see below).
If your hosting is elsewhere, then this is something you will need to deal with.
Ways to send email
There are several ways to send emails from your website.
Server-based SMTP
This is not recommended as your server may be shared with several other sites, and this means your IP Address is not unique to your domain name.
Authenticated SMTP
This is where your site email's using your own Gmail settings. We do not recommend this because it punches a security hole in your Google Workspace account. If your site gets hacked, then your email is also potentially compromised.
Transactional SMTP Provider
This is a company that specialises in delivering email for applications and websites. There are several, you can check out Postmark with their superb WordPress plugin and SendGrid.
Domain name settings
Regardless of the choice you make, you will need to add some DNS records to your domain name to authenticate it to the internet as a legitimate sender of your email. This helps Gmail see the incoming email as sent from a legitimate source, and not mark it as spam.
For a Transactional SMTP Provider, this will include DKIM (Postmark | SendGrid) or other provider-specific steps.
If you use Gmail and only your webserver your SPF would change from
v=spf1 include:_spf.google.com ~all
to
v=spf1 include:_spf.google.com ip4:50.201.69.200 ~all
Where '50.201.69.200' is your webserver IP Address.
You should also consult your web host if they support DKIM (they should) and how to add that to your domain name.
WordPress settings
Now you have your delivery options configured you now need to set up your forms to send from the correct address. You must send from the address / domain of your website (using Server-based SMTP), or the address / domain you configured in you configure in your Transactional SMTP Provider account.
Let's look at the typical form notification settings for two popular form plugins.
Contact Form 7
First, ensure you have a backup of every submission in your WordPress site just in case the email doesn't work. For Contact Form 7 we recommend Arshid's Contact Form 7 Database Addon – CFDB7
Incorrect configuration
Note that Contact Form 7 is great at telling you what is wrong. It recommends that your 'From' address is the same as your website domain. This is because you cannot legitimately send from the email address of the form submitter.
When we correct that to match the website domain, the error goes away.
Note that we have configured the 'From' to use the Name field from the form, so in your inbox, you will see that name as the sender. Secondly, in the 'Additional headers', we have the 'Reply-To' address. When you hit reply in your inbox this will send the email back to the submitter's email address they left you in the form.
WPForms configuration
Here we have configured the 'From Name' to use the Name field from the form, so in your inbox, you will see that name as the sender.
In the 'From Email' we do not use the submitter's email as we don't have permission to send email from them, so we must use our own email address here, as authenticated in our SMTP system, matching the website we are on.
Finally, WP Forms provides a dedicated field 'Reply-To Email Address', this is where you put the field that contains the submitter's email addres. When you hit reply in your inbox this will send the email back to the submitter's email address they left you in the form.
Review emails in the Google Workspace Email Log
Finally, if you still are not getting emails, look in the admin.google.com > Reporting > Email Log Search to find emails that you know should have arrived, and review the reasons for the blocks. If you cannot interpret the results please open up the email and expand the log. Then screenshot and send to us.