How to connect Contact Forms 7 to a Google Workspace Gmail
Contact Form 7 is the most popular WordPress contact form plugin by far. With “5+ million” installed, according to the Contact Form 7 entry in the WordPress plugin directory, nothing else comes close. It has its own dedicated site at
https://contactform7.com with a large quantity of useful information on how to make the most of it.
Google Workspace Gmail is, of course, the email app in Google’s productivity suite. While there exist
differences between Google Workspace Gmail and free Gmail, for the purpose of connecting Contact Forms 7 to Gmail we’ll take an approach that works for both.
Steps involved
These are the steps involved in setting things up:
- Install and configure Contact Form 7.
- Decide on a connection mode to Gmail.
- Install a mailer plugin (that supports connecting to Gmail).
- Configure the mailer plugin to work with Google Workspace Gmail.
1. Install and configure Contact Form 7
This is best explained at Getting started with Contact Form 7 and the rest of that site’s excellent documentation pages.
2. Decide on a connection mode to Gmail
At this stage you need to decide on one of two possible approaches to connecting to Gmail.
In fact, one of these approaches may be closed off to you by your Google Workspace administrator. They are:
- Tedious and more secure. This approach uses OAuth 2.0 for authentication.
- Quick and less secure. This approach uses SMTP for authentication. (This option won’t be available if either a.) you use two-factor authentication to sign into your account, b.) your IT department has disabled “Access for less secure apps”.)
3. Install a mailer plugin
This is where instructions start diverging, based on your choice of connection mode above. Install a mailer:
OAuth 2.0 | SMTP |
---|---|
Install | Install |
4. Configure the mailer
OAuth 2.0 | SMTP |
---|---|
Follow the instructions for | Follow the instructions for Connection details for the Gmail SMTP server are: SMTP Host: smtp.gmail.com SMTP Authentication: True SMTP Username: Your full Gmail address, e.g. seymour@mylittleshop.com SMTP Password: Your Gmail password Type of Encryption: TLS SMTP Port: 587 From Email Address: The email address from which emails will appear to be sent unless overridden by your form. From Name: The name from which emails will appear to be sent unless overridden by your form. Disable SSL Certificate Verification: Leave unchecked |
5. Make Gmail accessible to the mailer plugin and retrieve credentials
OAuth 2.0 | SMTP |
---|---|
Follow the instructions at By the end of this process you should have a set of new credentials: a Client ID and a Client Secret. | Follow the instructions at The credentials you’ll need for later are: your Gmail username and your Gmail password. |
6. Test site-wide emails
If sending your test mail from within the mailer succeeded in step 5, your WordPress site is all set up for sending emails. You can verify this, for example, by requesting a password reset email.
7. Test Contact Form 7 emails
If sending yourself a password reset worked, Contact Form should work, too.