How to Send Email in WordPress using the Gmail SMTP Server?


Are you searching for a way to send email in WordPress using the Gmail SMTP server?

The process of sending and receiving emails is quite common these days. One might have a problem sending emails directly from the WordPress site. Thus, the easiest way to do so is using the Gmail SMTP server. 

We will cover the proper definition of SMTP as well as reasons to add them. Additionally, this guide also discusses the complete steps to send email via the Gmail SMTP server in this article. Without further delay, let’s start:

What is SMTP?

Before learning to add SMTP to your site you must have proper knowledge about it. Generally, SMTP is a server that is highly used for exchanging emails between sender and receiver. Moreover, it consists of an address that is set by the mail client you are using. The format is like

However, if you are a Gmail SMTP user, the address would more or less be like Also, to find out the SMTP server address check below the account settings of your email client. 

The SMTP plugins consist of both free and premium versions. For a better experience, we recommend you use the premium package: WP Mail SMTP Pro. Here is the list of some of the significance of the Gmail SMTP server:

  • The use of this server is free of cost for the lite version, you just have to create a google account.
  • Provides a better user interface to all the users.
  • Easy configuration of the plugin enables the users to use the plugin in no time.
  • This server is considered to be secure as it uses various methods for verification and offers a layer of security. 

Reason to Add Gmail SMTP Server for WordPress Emails

The use of emails in the WordPress site is basically for the purpose to notify you about the new user, lost password, and notifications from your contact forms. For this, WordPress uses the PHP mail function by default. The function does not work effectively and fails in terms of security for various reasons.

The mails have to be checked if they are sent from authentic mail servers to prevent them from hackers and protect them from spam. Additionally, the function might disappoint you as it fails this check of your emails. You need to switch from PHP to SMTP for a better user interface as it uses proper authentication which ultimately increases email distribution.  

Steps to Send Email in WordPress using the Gmail SMTP Server

You can start working with your free Gmail account but for a better user interface, we recommend you to use the paid version of G Suite. This permits you to create your own professional branded email address such as 

In order to work with G Suite, you need to set the domain to work with Google Apps. The rest of the steps are similarly irrelevant to the version of your plugin. Follow the steps mentioned below:

Initially, install and activate the plugin WP Mail SMTP.

After activation, head to WP Mail SMTP >> Settings to configure the page.

Initially, you need to fill in your Gmail email address in the “From Email” and then provide your sender’s name.

Let’s get into the process of setting up Gmail SMTP for sending emails: 

1. Using OAuth Protocol

Among other methods, we recommend this method for all users. In addition to this, it is more secure and you only need to configure the plugin once. In simple words, after setting up, you don’t have to repeatedly configure the plugin time and again. 

Here, you should select Gmail as your mailer and check the box beside the return path.

Next, you will have to enter your Client ID, Client Secret, and a URL in the “Authorized redirect URI’ fields. Now, moving towards setting up these fields:

Creating an App and Generating APIKeys for Gmail

  • Start by visiting the Google Developers Console website and clicking on the Create Project tab.
  • Secondly, you need to provide a memorable name to your project and click on the “Create” button.
  • Now, it’s time to find out about APIs and services. The developers are allowed to access APIs through google. You just need to click on the “Enable APIs and Services“. 
  • Head to the APIs library page, type Gmail in the search box, and click it.
  • On the next page, you will find an overview of the API, simply click on the “Enable” tab.
  • After enabling the API. The next step to carry on is to create credentials. For this, click on the option ” Create credentials“.
  • Click on the OAuth client ID.
  • Next, you have to select the option “Web application “ from the drop-down menu.
  • Here you are asked to enter your OAuth client name, you can add “WP Mail SMTP“.
  • You can add your website’s domain name under the JavaScript origins field. After that, you have to copy and paste the authorized redirect URL from the setting page of the plugin.
  • All you need to do is click on the continue button and the developer console will reveal your client ID.
  • Copy and paste this into your WP Mail SMTP plugin’s setting page. Scroll down to the bottom of the page and click on the “Allow plugin to send emails using your Google account” button. Again, don’t forget to click on the “Save Settings” option.
  • Now this will head to your account on google, and ask you to grant permission to send emails on your behalf. Click on the Allow button to give permission.
  • Lastly, you are redirected back to your website with a success message.

2. Setting up Gmail SMTP as SMTP Sender

This method manually connects Gmail’s SMTP servers to send your WordPress emails. 

Firstly, start by visiting WP Mail SMTP >> Setting for configuration. Provide your Gmail address in the “From Email” field and your name in the “Name” field. Select “Other SMTP” as your mailer and check the box beside the return path.

For more configuration, scroll down to the Other SMTP. You need to follow the exact configuration as in the screen displayed below:

Finally, click on the save changes button. 

Note: As your password is stored in text, this method is considered less secure.

Wrapping up

Lastly, we hope this tutorial taught you to Send Emails in WordPress using the Gmail SMTP Server. Also, go through our other tutorial “How to Change the Admin Email of WordPress Website?” to learn more about WordPress. 


Please enter your comment!
Please enter your name here