
Although it is a rare occurrence, sometimes you may set up forms on your WordPress site and find that responses never make it to your email inbox. To avoid this, it’s important that your site has the proper SMTP configuration. SMTP, or Simple Mail Transfer Protocol, is simply a protocol like POP3 and IMAP. However, while POP3 and IMAP are specifically for retrieving emails from a server, SMTP is only for sending emails, which is why it is important to correctly configure the SMTP if your WordPress site has contact forms.
This process is complicated and we always recommend letting a developer integrate WP Mail SMTP. However, we are aware that sharing your Google account details with anyone is not ideal. If your WordPress contact form is not working, and you’d prefer to handle things yourself, here’s a guide on how to correctly set up SMTP on your site using the WP Mail SMTP plugin.
Why Aren’t You Receiving WordPress Form Responses via Email?
Put simply, most WP plugins use the PHP mail() function to send emails. This function sends emails directly from your web server, translating PHP scripts to a legible email. Unfortunately, many web hosting servers do not support this function or need to be configured to allow PHP mail(). On top of this, you have linked your WordPress site to your email address which is likely a Gmail account. Most large email providers have a system of protecting you from spam. Often, emails that aren’t trusted by the email provider are sent to your spam box or blocked entirely.
Since you have connected your Gmail account to your site, it will use the Gmail server. However, if you’re using a form plugin, emails originate from Gmail but are actually sent from your web server. When emails originate and are sent from different locations, email providers will block the email (form response) entirely.
To fix this, we use the WP Mail SMTP plugin, which alters the way emails are sent from your site and properly authenticates them.
Setting Up WP Mail SMTP With Gmail
First, go to “Plugins” from your WordPress dashboard, and “Add New.” Here, you’ll need to search for WP Mail SMTP and find the correct plugin. In the top right corner, click “Install Now”.
Once the plugin is installed, activate it and head back to your dashboard. On the left sidebar, find WP SMTP and select it to begin the integration.
-
Authorizing the Gmail Mailer
Scroll down to the mailer options and select “Google/Gmail,” once you’ve done this new options will appear below. In a new tab, go to Google Cloud Console. Make sure you are signed in to the google account you want to link to your website.
-
Creating a New Project in Google Cloud Console
Double-check that you are signed into the correct Google account by clicking on your profile in the top right corner. Once you have confirmed this, click on the “Select a project” drop-down box.
Once the pop-up appears, select “New Project” in the top right corner. The new project will automatically name itself, however, you can customize it. You might find that Google won’t allow you to continue unless you select a “location” or “parent organization,” this is the case for users with different Gmail accounts registered to the same name.
-
Enabling the Gmail API
Head back to the Google Cloud Console dashboard and ensure the new project is selected in the drop-down box. Then, in the menu, hover over APIs and Services and select “Library.” In the library, search for “Gmail API,” select the correct result and click “Enable.” Once the API is enabled, you will be automatically redirected to the Gmail API overview page.
Click on “Create Credentials” and then answer the questions on the next page. When creating credentials, you’ll need to select “Gmail API” and then select “User Data” before clicking “Next”.
Next, you’ll fill in the name of the plugin you’re using on the site, WP Mail SMTP, and choose your email address from the drop-down list. The App logo section is optional, but not at all necessary. Then, scroll down and type in your email address into the “Developer Contact Information” and click “Save and Continue.”
The next section on Scopes is optional, so you can scroll to “Save and Continue” to move to the next step.
In this step, select “Web application” from the drop-down list. The Name in the next field will be automatically generated, you can change this, however it’s purely for identification and won’t be seen by anyone. The “Authorised JavaScript origins” section is optional and will not be needed for this integration. Scroll past it to the “Authorized redirect URIs” section.
Go back to your WordPress tab and scroll down to “Authorized redirect URI,” you will need to copy this link and paste it into Google Cloud Console.
Simply copy the link, head back to your “API Create Credentials” tab, and click “ADD URI” under Authorized redirect URIs. Paste the link here and click “Create.” After this, your Client ID will appear, but you don’t need it just yet. Click “Done” on the bottom of the page, and you will be redirected to the Gmail API page again.
-
Change App to External Mode
If you have Google Workspace, Google will automatically set your user type to internal. Since you want this app to work for the public, you’ll need to set the user type to external.
On the sidebar, click “OAuth consent screen”, and under “User type”, click the box that says “MAKE EXTERNAL”. Once you’ve selected that, a pop-up will appear to select “Publishing status”, in this case, choose “In production” and then “CONFIRM”. If you’re using a free Gmail account, the page will appear as the above screenshot. In this case, click on “PUBLISH APP” under “Publishing status” and click “CONFIRM”.
-
Find Your Client ID and Client Secret
Next, click on “Credentials” in the sidebar. Under “OAuth 2.0 Client IDs,” find the name of the client ID you created in step 3 (this will be Web Client 1 if you did not customize it) and click on the pencil icon in that row. After clicking the pencil icon, your Client ID and Client Secret will be revealed. You will need to copy and paste each one into the correct blocks on the WP Mail SMTP general settings page that you have opened in the other tab.
First, copy the Client ID and paste it into the Client ID block in the WP Mail SMTP settings, followed by the Client secret.
Then, once both codes are pasted, scroll down and click “Save Settings.” Once you have clicked save, a new button will appear. Click on the “Allow plugin to send emails using your Google account” button and wait to be redirected.
You will be redirected to the Google login page. Here, choose the correct account that you have set up Gmail API on and log in. You may see a page that says, “Google hasn’t verified this app,” if you’re using a free Gmail account. This appears because you have just created the app and verified it yourself. Google advises that you only proceed if you trust the developer. In this case, you are the developer, and it is safe to continue.
To move past this, click on “Advanced” in the bottom left corner and then click on “Go to wpmailsmtp.com (unsafe)”. Then click “CONTINUE” to be redirected back to the WP Mail SMTP general settings page on your WordPress site.
Once you’ve been redirected back to WordPress, you’ll see a message confirming that you have successfully linked your current site to the Google API project.
-
Test Your Email Delivery
If you have WP Mail SMTP Pro, you can send a test mail from the plugin settings page. If you are using the free version, simply open an incognito browser tab by using the keyboard shortcut below:
Chrome: Ctrl+Shift+N
Mozilla Firefox: Ctrl+Shift+P
Safari (Mac): Command+Shift+N
Then, navigate to your live contact form and send yourself a test email. Check your email inbox – including your spam for an email. If you still don’t receive anything, double-check that you have correctly followed the steps above and contact a developer for support.

Matt, the founder of Travel Tractions, has done marketing for travel and tourism for over a decade. His first love is SEO, with entrepreneurship hotter on its heels than a girlfriend. When he is not looking up flights back to Asia you can find him in the garden, making excuses to walk Rusty, strategizing with the team and tinkering on sites until the early morning.