BLOG

How To Send Emails in WordPress Using the Gmail Smtp Server

Do you want your WordPress website to send emails?

The Gmail SMTP server provides the functionality that enables us to solve this problem. This article will tell you everything you need to know for sending an email using the Gmail SMTP server.

What is Gmail SMTP Server:

Gmail SMTP Server is a service provided by Google to send emails from the WordPress site to the users using your Gmail account. It also enables you to configure third-party applications such as outlook and thunderbird to send email via your email address.

Why do you need Gmail SMTP Server?

Assume that you have heavy traffic on your website. Users are registering and need a confirmation email. Some are requesting a password reset, and others are subscribed for the daily update. You cannot send all these emails manually.

WordPress uses a PHP server to send emails, but there are some problems with that as these days, there are filters that check if the mail was sent from an authentic email. But the PHP server fails that test, and emails are sent to the spam folder.

Because of this issue, many companies restrict the use of this functionality as well. To solve this issue, SMTP is becoming a new industry standard. It provides a better delivery rate that is why it is the best option.

There are some limitations of this service, as well as it does not perform well when the number of mails increases, so it is recommended to use mass emailing service like Mail gun to solve the issue. As it performs better if you want to send the newsletter emails.

Free vs. Paid SMTP Services:

SMTP provides free services in which you can send the mail through your private email address, but you can also buy the G suits for better functionality. If you want to have a branded email like “[email protected]’ then you will need to buy G suite.
You can add MX records which will give a boost to the deliverability as it makes it look like that it is coming from your domain.

How to Send WordPress Emails Using Gmail SMTP Server:

To get started with the SMTP server, you will need to set up the domain. We will give a step-by-step tutorial to achieve the final task. First of all, you need to install the WP Mail SMTP plugin. This plugin provides the best way to send the mails through the WordPress site with a higher delivery rate. You can also buy the pro version of the WP Mail SMTP plugin, which will give you better functionality and premium support.

After activation, you need to configure the plugin setting to SETTING==>WP Mail SMTP.

Enter your Gmail email address in the email field. After that, enter your name in the From Name field.

SMTP offers two ways that you can use to connect to your Gmail server.

OAuth Authentication is the first method that is more secure and recommended by the
experts. The second method is manually entering Gmail SMTP settings. It is less secure than the first one.

In this article, we will discuss the OAuth Protocol method.

Using OAuth Protocol:

It is the most secure method and is used by the majority of developers from around the world.

Step 1

First of all, select Gmail as your mailer and set the return path to the same as the sender by selecting the check box in the return path.

Next, you will have to provide the Client ID, Client Secret, and a URL. To get these credentials to keep reading the article.

Creating a Project and Generate API Keys for Gmail:

Step 2

Visit the Google Developers Console and create a new project by selecting the button with create a project written on it.

Step 3

After that, enter the project and organization name and select create. Your project is now created, and you can add many APIs provided by Google.

Now you will add the APIs that will be needed in this project.

Step 4

Select Enable APIs and services to add APIs. You will be directed to the APIs library. From this page, you can search and select any API.

Step 5

Search Gmail API from the search bar and click on the Gmail API, which will take you to the next page.

Step 6

Click the blue enable button, which will add it to your project.

Step 7

Now select the create credential button to create the credential. After that, select Gmail API and select user data after that, select next.

Step 8

After that, Fill the form like in the app name, enter the name like SEO services in wah cantt and email address and select next.
You can also add a scope or skip it because it is optional. To skip, click save and continue.

Step 9

The next step is to create an OAuth ID for this. You need to give the Application type and name of your OAuth client.
You can also add Authorised JavaScript origins by giving a URL.

Step 10

Next is to select the create button, which will create your ID. You can download it as a JSON file or copy it to your clipboard.
At the end, select Done to save the process.

Step 11

After this, you can check the added credentials listed on the credential page.

Step 12

Now take the Client ID that you copied earlier, or you can get it again from the edit option from the listed credentials and paste it in the plugin’s Settings page.

Step 13

You also need the secret key that you will get from the edit option from the listed credentials to fill the field in the plugin’s Settings page. Click on the Save button to move forward.
It will save the changes and reload the page. Now scroll down and select the button labeled as “Allow
plugin to send emails using your Google account”

Step 14

After this, you will be taken to your account on Google, which will ask for your confirmation. Select allow permission to send emails through your Gmail address.

Step 15

After this, you will be sent to your website, where you will see a success message.

 

Leave a Reply

Comment policy: We value comments and the time that visitors to our blog spend to give feedback. Please note that all comments are manually moderated and any deemed to be spam or promotional will be deleted.