How To Send Emails From WordPress Using Gmail SMTP?
January 24th, 2017 | by Ravi Chahar || 10 Comments |
WordPress uses the PHP mail function to send notifications to its users. Whether it’s about sending an email regarding the comment approval or anything similar to that.
In some cases, the emails get failed and WordPress users don’t even realize it.
To solve this problem, many people are using the SMTP( Simple Mail Transfer Protocol ). It can be done using your regular Gmail account.
It’s one of the basic mail standards which is safer than the default PHP mail function used by WordPress.
In this tutorial, you will learn to the way to send emails from WordPress using Gmail SMTP.
How To Setup A Gmail SMTP Account For Your WordPress Website?
You would know that many people are using their professional email address.
You can create an email address with your own domain name. And if you’re aware of Google apps for work or now we call it G Suite, then you can also setup a professional email address with G Suite too.
If you’re not running a website then you can get your custom email address with an annual fee.
To make it look professional, you can use your domain name email address so that people can know that the message has been sent from you.
Many people connect Webmail to Gmail account so that many email addresses can be handled from one Gmail account.
A Step By Step Guide For Gmail SMTP Setup.
Follow the steps and within a few minutes, you will have your job done.
Step 1:- Install and activate a WordPress plugin Gmail SMTP.
Step 2:- After installation, go to settings>>Gmail SMTP and you will see a notification stating that the plugin won’t work until you create a web app.
So what are you waiting for? Let’s create an app.
Step 3:- Click on the link of “Web application” in the plugin and you will be to the Google’s account. It’s because to authenticate your website for the use SMTP server, you have to create the API keys.
You will see two radio buttons, fill them and go on.
Step 4:- After that, you will see that the API is enabled and now is the time to enable the credentials.
Click on the “Go To Credentials” button.
Step 5:- You will see a few options. Under “Where will you be calling the API from?”, choose “Web browser(JavaScript)”.
And under “What data will you be accessing?”, choose “User data”.
Click on the “What credentials do I need?” button and a next page will open.
Step 6:- Now, you will be asked to fill the URL of your website. There are two fields. One is to fill the URL of your website and other is shown in the plugin settings.
Under “Authorized JavaScript origins”, fill the URL of your website and under “Authorized Redirect URIs”, copy from the plugin settings and paste it.
Click on the “Create client ID” button.
Step 7:- This process is authenticated by an OAuth standard for which, you have to fill the details.
Fill the Gmail email address you want to show to your readers and the name of your website.
It’s the name of the app which is going to access your Gmails account.
Click on the “Continue” button.
Step 8:- Your account with your Gmail email address is ready. It has been authorized by OAuth and you just need to click on the “Done” button.
You will see the client ID for the project you have chosen.
Step 9:- After this, you will see the name of the project for which, you have created this account.
If you have already generated any old projects then the list would contain all of them. But for now, see the name of the project you have chosen in the starting.
Click on the name and all the details will be there.
Copy the “Client ID, Client Secret” and paste them into the plugin’s setting.
Step 10:- You will see many other options including the email you want to use and more.
Fill the proper details under each section. You have to use the same email address which was used while creating the account in the Google developers website.
For “type of encryption” use “TLS” and for SMTP Port, use 587.
Fill the details and save.
Even after saving, you will get an option to “Grant Permissions”. Just click on that button and it will take you to the Google’s website to grant the permission.
It checks the IDs you have mentioned in the plugin. To send emails from WordPress using Gmail SMTP, you have to grant this permission.
Step 11:- After redirecting to the plugin’s page, you will see the status of the Gmail SMTP service has been enabled.
The button has turned green. It means you have successfully setup the SMTP for your WordPress website.
Now, you can send the emails to your readers using the secure Gmail SMTP servers.
You won’t need to worry about the emails loss.
To clear your doubts, you can send a test email to your friend or to any other email address.
Choose it from above in the plugin settings and just like anything else, fill the email address, subject, and the message.
Within a second, you will receive the same message to your email address.
WordPress mail function takes some time to send the emails but as you know, Google doesn’t do that. Within a second, the message will get delivered.
Now, You Can Send Emails From WordPress Using Gmail SMTP Servers.
Is there anything you want to ask?
What’s the best email you should use? As I have mentioned earlier, you should use your professional email address.
But, here is a simple Gmail address would work for the best. You can handle all the email account using one simple Gmail account.
The choice is yours. You just have to create the APIs to authenticate SMTP servers to your WordPress website.
One of the major conflicts occurs when you use the different email address in the plugin settings.
As mentioned under the plugin fields, you should use the same email address which has authenticated by Google developers.
I hope now you can send emails from WordPress using Gmail SMTP.
If you still have any question, feel free to ask.
You can also connect with us on Twitter, LinkedIn, and Facebook.
Hi Ravi,
Fascinating stuff and super clear tutorial as always.
I had no clue you could send emails from WordPress using this method.
Thanks for enlightening me once again.
Ryan
Hey Ryan,
WordPress has many hidden features which are yet to be revealed. SMTP is the safest method to send the emails. As we all know about Google, it’s 100% in its service.
You just have to integrate an app with SMTP and you’re good to go.
Thanks for stopping by.
~Ravi
Hey, Ravi.
This is very new to me. I never think before about it.
As usual, You write this tutorial perfectly and clearly.
Thanks again buddy.
Hi Paramjot,
There are many other things which amaze you. Sending your emails from WordPress is just the starting.
Thanks for stopping by.
Enjoy your week ahead.
~Ravi
Hello Ravi,
Super post! I was not aware of it. It’s awesome to know that using Gmail SMPT we can send emailers to our subscribers.
Nice tutorial mate.
Hey Atish,
This is something I just discovered and it’s amazing. No one can deny the Google services. Send your emails from your admin panel only.
Thanks for stopping by.
Enjoy your day.
~Ravi
Hi Ravi,
I had no clue we could do this via WordPress. You have done a wonderful step by step tutorial and I thank you for it.
You have broke it down and made it easy to do.
-Donna
Hey Donna,
Most of the people are dreaming whether it can be done or not. Even I was so amazed. But when I tried it, the experience was awesome.
I am glad that I could make it simple for you.
Have a great week ahead.
~Ravi
Hi Ravi,
Each time I visit your blog is one useful WordPress tutorial after the other.
Sincerely speaking, this one exceptional. I really learn something new today. I never though of using Gmail to send WordPress emails.
You’ve it break down in such a way even the layman can understand.
Thanks for sharing.
Hey Shamsudeen,
WordPress is full of surprises and you can do a lot of other things which haven’t even explained.
I am glad that you could learn something new. It’s always good to know that I am helping someone.
Use Gmail SMTP service for the safest email.
Thanks for your putting.
Enjoy your day.
~Ravi