Come, meet us at Wordcamp, Torino, Italy on 14th and 15th June 2024 Click here
Scroll to top

How To Configure SMTP With Gmail Account in WordPress

SMTP Server Settings

Trying to send email from your word press website, but failing again and again? This could be because of several reasons, but the most common reason is the problem with the email server in the web host. In such situations, you can use your Google account and configure it in your wordpress website to start sending mails through it.

The process of configuring Gmail account in WordPress website is fairly easy…….

Follow the below mentioned steps:-

1.  Install WP Mail SMTP Plugin

Step-1 First you have to install the WP Mail SMTP Plugin and activate it.

Go to the plugin setting  as shown WP Mail SMTP Plugin->Settings.

Step-2 Click on General option from WP Mail SMTP setting and leave “From Email” option blank as you can see in image below, because email will be received by your Gmail configured email id.

Step-3 You can fill the  option  like “From Name” with you website name and you have to check  the “Return Path” option.

Step-4 Now you have to choose the “Mailer”, so select “Gmail”.

Step-5 We will find the “Client ID” and “Client Secret” detail from the Gmail account to configure the SMTP.

2. Move to create a Web App from Gmail account

Step-1  Sign into your Gmail account and access Gmail’s for SMTP configuration click here

Step-2 After login with your Gmail account, you have to click on the “Continue” option to create a project.

Step-3 Now click on “Go to Credentials” link to enable the API.

Step-4 You can see “Add credentials to your project” page, here we have to fill the credentials like which API are you using? In Field, we will choose the “Gmail API” option.

Second is where will you be calling the API from? In Field, you will choose web server (e.g. node.js, Tomcat) option and in the third you will check “User data” and at finally click “What credentials do I need?” button.  As in the screenshot below, you can see how options are filled.

Step-5 Now a popup will appear on the screen, click on the “SETUP CONSENT SCREEN” option.

Step-6 You will see a OAuth consent screen page Choose  “External “ from the “User Type” and click on “CREATE” button.

Step-7 Fill the name of your website in “Application name” field and then click on “SAVE” button.



Step-8 Now move back to the“Dashboard” and Click on WP Mail SMTP settings and copy the Authorized redirect URI from there and paste it into the field under “Authorized redirect URIs”.

Step- 9 Enter the domain name in“AuthorisedJavascript origins” like and press the enter button.

and click on the “Refresh” button, it will get changed into “Create OAuth client ID” button as seen in the image below and click on it.

Screen -1

Screen -2

Step-10 Now you can see I have got “Client ID”, Click “Done” button now.

Step-11 In OAuth 2.o Client_id section, Click on “edit” option to get the Client ID and Client Secret detail.

Step-12 Now copy the Client ID and Client Secret detail and go to the website Dashboard panel.

Step-13 Go to WP Mail SMTP settings on website Dashboard and scroll down the page you will get the Client ID and Client Secret field, where I will paste  Client ID and Client Secret detail which I copied in Gmail account.

Step-14 Now you will see the message on your screen, it will show “Settings were successfully saved” and Now Scroll down the page you will see the option “Allow plugin to send emails using your Google account” you have to click on it.



Step- 15 Login with your Gmail account and it will ask you for permission to send an email by your Gmail account, now you have to click on Allow button to proceed.





Step-16 when you allow Gmail account access it will show successfully message in wordpress dashboard.

Step 17 In the last point you can send a test mail by WP Mail SMTP, for this  you have to click on Email Test option and enter your email id in the “Send To” field, where you want to receive the test mail.

Author avatar
Public advisory against the common scams. Click to read more.