How to configure Gmail SMTP in your WordPress site?
Gmail SMTP server can make your life easier and that’s exactly what we are going to cover in this blog.
Among the most common use cases of triggering emails from your websites, password resets, user registration and contact forms top the list.
WordPress uses the PHP mail function to get this job done, which is not as reliable as most web hosts have imposed restrictions on the use of these functions.
SMTP stands for Simple Mail Transfer Protocol which uses proper Authentication that increases deliverability. Gmail provides SMTP services for mail sending and we can easily configure it with our website.
We have tried to outline a step-wise walkthrough for this whole configuration:
Install and Activate the “WP Mail SMTP” plugin from Add new plugin.
Go to WP Mail SMTP > Settings from the admin panel.
In the Mail section Fill in the details of your Gmail account.
Go ahead and select Mailer Google/Gmail.
When you select Google/Gmail as a mailer It will ask you for Client Id and Secret.
Below are the steps to get the client Id and secret:
a) Open a New tab in your browser and browse to this link. It will redirect you to Google Cloud Platform where you can log in using your Gmail Account and click on CREATE PROJECT.
b) Insert Your Project Details and click on create.
c) On Project Dashboard, Go to the API section and click on Go to APIs overview
d) Click On + ENABLE APIS AND SERVICES, it will redirect to the API library.
e) In the API library, Scroll down to Gmail API and Click it.
f) Click on the Enable Gmail API.
g) After enabling Gmail API, click on the CREATE CREDENTIALS button.
h)Start Steps of Create Credentials – Add Credential Type.
i) Scroll down and add the required information on the OAuth Consent Screen details and Save it.
j) Skip Filling 3rd step and Save it and add details OAuth Client id details as below:
k) Now you get Your Credentials, you can copy or download credentials, Or just click DONE.
l) Click on your Client name
m) Here you get a client ID and Secret.
Now Go to WP Mail SMTP > Settings again and copy this ID and Secret.
n) Copy this Authorized redirect URI.
o) Paste the copied URL to the above step-XIII (after scroll down) and Save.
Now get back to your WP Mail SMTP admin page. After filling in Client Id and Client Secret, click on Save, and after that Click on Allow Plugin to Send emails using your Google account.
After Successfully saving these details, set up your contact form and Email setting in the form.
We are ready for mail now.
The Gmail SMTP has been configured properly and you can start seeing emails coming to your inbox.
See this link to know more about WordPress – WordPress blogs