Table of Contents
Do you want your WordPress website to send emails? The Gmail SMTP server provides the functionality to solve this problem. This article will tell you everything you need to know about sending emails using the Gmail SMTP server.
What is a Gmail SMTP Server?
Gmail SMTP Server is a service Google provides 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 emails via your email address.
Why do you need a Gmail SMTP Server?
Assume that your website has heavy traffic. Users are registering and needing a confirmation email. Some request a password reset, and others subscribe to the daily update. You cannot send all these emails manually.
WordPress uses a PHP server to send emails, but some problems exist. These days, filters check if the mail was sent from an authentic email address. But the PHP server fails that test, sending emails to the spam folder.
Because of this issue, many companies also restrict the use of this functionality. To solve this issue, SMTP has become a new industry standard. It provides a better delivery rate, which is the best option.
This service has some limitations. It does not perform well when the number of emails increases, so it is recommended to use a mass emailing service like Mail Gun to solve the issue. It performs better if you want to send newsletter emails.
Free vs. Paid SMTP Services
SMTP provides free services for sending mail through your private email address, but you can also buy G Suite for better functionality. If you want a branded email like “abc@sitename.com, “you must buy G Suite.
You can add MX records, boosting deliverability by making it look like the message is coming from your domain.
How to Send WordPress Emails Using Gmail SMTP Server
You must set up the domain to get started with the SMTP server. We will give a step-by-step tutorial to help you achieve the final task. First of all, you need to install the WP Mail SMTP plugin. This plugin provides the best way to send emails 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 must 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 to connect to your Gmail server.
OAuth authentication is the first method that is more secure and is recommended by
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, 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 so you can continue 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 “create a project” button.
- Step 3: After that, enter the project and organization name and select Create. Your project has been created, and you can add many Google APIs.
- Now, you will add the APIs 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: Use the search bar to find Gmail API and click on it to proceed to the next page.
- Step 6: Click the blue enable button to add it to your project.
- Step 7: Now select the Create credential button to create the credential. After that, choose API Gmail and user data, then select next.
- Step 8: After that, Fill out the form; in the app name, enter the name, like SEO services 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 creating an OAuth ID. You need to provide the application type and name of your OAuth client.
- You can also add Authorised JavaScript origins by giving a URL.
- Step 10: Next, select the Create button to 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 on the credential page.
- Step 12: Now take the Client ID you copied earlier, or you can get it again from the edit option from the listed credentials and paste it into the plugin’s Settings page.
- Step 13: It would be best if you also had the secret key that you will get from the edit option from the listed credentials to fill out the field on 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 “Allow plugin to send emails using your Google account.”
- Step 14: After this, you will be taken to your Google account to request confirmation. Select Allow permission to send emails through your Gmail address.
- Step 15: After this, you will be sent to your website to see a success message.