Jan 03, 2023
How to Use Google SMTP Server
If you have a Gmail account or Google business email account (Workspace), you might want to use its free SMTP service. Aside from using your hosting’s portable SMTP server or other third-party email clients, you can send emails with Google’s SMTP server as it’s reliable, secure, and fast.
However, not a lot of people are familiar with Gmail’s SMTP server and how to use it.
In this tutorial, we will show you how to activate Google’s SMTP server from your Gmail account and WordPress site. We will also walk you through Gmail SMTP settings.
What is SMTP?
Simple Mail Transfer Protocol (SMTP) is a set of commands that directs the transfer of emails. When you send an email, it will be forwarded from your email client (such as Microsoft Outlook, Gmail, or Mozilla Thunderbird) to the SMTP server. The server will then relay the mail to the recipient’s email server.
The recipient will receive the mail once it’s downloaded from the email server via POP3 or IMAP. There are two types of SMTP servers — internal and external.
Most hosting providers, such as Hostinger, offer an internal SMTP server.
However, you should consider using an external SMTP server, such as Google’s SMTP server. It provides several benefits that you might want to consider:
- Reliable. Google SMTP server doesn’t use port 25 to avoid spam flagging. Hence, it gives better email deliverability.
- Convenient. No need to set up your own outgoing mail server (if you use VPS).
- Secure. It requires two-factor authentication, and emails will be backed up in Google’s servers. In addition, Google requires you to have a secure connection for sending mails.
Keep in mind that Google limits outgoing emails to 500/day for trial accounts and 2,000/day for GMail and GSuite. Still, it’s a great deal for sites with low email volumes.
How to Use Google SMTP Server?
In this section, we will show you how to send emails using Google’s SMTP server through a custom domain via your Gmail account or with a plugin in WordPress.
Before we continue, keep in mind the following details to configure your Google SMTP server settings:
- Gmail SMTP server: smtp.gmail.com
- Gmail SMTP username: Your full Gmail address, such as firstname.lastname@example.org
- Gmail SMTP password: Your Gmail password.
- Gmail SMTP port: 465 (SSL)/587 (TLS)
- TLS/SSL: Required.
Using a Custom Domain
If you have a custom email address, the process to connect to Google’s SMTP server is simple. But first, make sure that you have an email address with a custom domain and a Gmail address. Go through the instructions on how to create an email if you experience any difficulties.
Before proceeding, you need to prepare a Google password – which will give your custom email address permission to access a Google account. Make sure to activate the two-factor authentication on the Gmail address beforehand.
Once you have the Google password, log in to your Gmail or Google workspace account and follow these steps:
- Navigate to Gmail Settings by clicking the “gear icon” in the top right.
- Hit the Accounts tab and click on Add another email address.
- A pop-up window will appear. Fill the required information and press the Next Step button.
- Enter Google’s SMTP server, your Gmail address, and the app password you’ve created earlier in the respective fields.
- A verification email will be sent to your custom email address. Open it and click the confirmation link.
That’s it! Now your custom email address has been linked with Google’s SMTP server. You can also start sending emails from the custom address through your Gmail account.
Using a WordPress Plugin
For WordPress sites, you can use a plugin to send emails using Google’s SMTP server. There are plenty of SMTP plugins, but in this tutorial, we will show you how to use WP Mail SMTP:
- To install the plugin, access your WordPress admin dashboard and go to Plugins -> Add New. Search for the “WP Mail SMTP by WPForms” plugin, then Install Now -> Activate.
- Navigate to WP Mail SMTP from your WordPress dashboard. Click on Settings. Fill in the From Name field and choose Gmail in the Mailer section.
- Don’t forget to check the “Set the return-path to match the From Email” checkbox to get notifications each time there’s a delivery issue.
- Scroll down, and you’ll see the Client ID and Client Secret fields. To fill them, you have to create a web application in your Google account.
- Open a new tab, go to Google API Console, and log in with your Google account.
- Click Create Project, create a Project Name, and hit Create.
- Then, select the API Library on the left side of the dashboard. Search for “Gmail API”.
- Enable Gmail API and click Create Credentials.
- A “Set up OAuth consent screen” window will appear. Click “Set up consent screen”.
- Pick your User Type. Fill the Application name with your website’s title.
- Go back to the WP Mail SMTP -> Settings on your WordPress dashboard and copy the Authorized redirect URI.
- Go back to APIs & Services page, paste the URL to the Authorized redirect URIs field in the Credentials section. Click Create.
- You will see a pop-up window containing the Client ID and Client Secret. Copy both and paste them to the WP Mail SMTP Settings page under the Gmail section. Don’t forget to press the Save Settings button.
- Press the “Allow plugin to send emails using your Google account” button next to the Authorization section.
- Connect your Gmail account and allow your website to manage it.
- Send a test email to make sure that everything works properly. This can be done in the WP Mail SMTP -> Email Test tab.
If the email is successfully delivered, it will look like this:
An SMTP server is essential in the mail delivery process — it’s responsible for transferring emails from an email client.
That’s why using an outgoing SMTP server like Google SMTP is an excellent choice since it provides a free and reliable solution, especially for sites with low mail volumes.
In this article, you’ve learned how to use the Google SMTP server in two ways — through a custom domain and using a WordPress plugin.
Do you have any questions regarding this topic? Share your thoughts in the comment section below!
October 05 2017
It has an error, says, "Message body empty"
October 14 2017
When trying to send an email with my google account, I get this error message— CANNOT SEND MAIL the connection to the outgoing server “smtp.gmail.com” has failed. Additional outgoing mail servers can be configured for mail accounts in settings>
November 30 2017
Have you done this: "Access for less secure apps can be easily turned on here."
February 26 2018
The "SMTP Port Number" mentioned in Step I is wrong, it is '587', I followed the instructions literally and was getting Stack Trace error because of it, so i rechecked the settings changed the port number to 587 and then i was able to get the mails sent. Nice tutorial though Thanks!
February 27 2018
Hey Kadahsh, Thanks for pointing this out. Tutorial has been updated with a correct port number!
June 10 2019
Worked like charm! Thanks a lot for the detailed steps.
February 11 2020
this is great info!!
August 02 2020
Thank for the helpful information! Google and Gmail have so many moving parts that your tutorial saved a lot of time. My Gmail account addr is different from the addresses I use on my server so I had to uncheck the alias box so that when people replied it would go back to my server instead of the gmail account.
November 06 2020
Hey Brian! Happy to hear it helped! :)
August 27 2020
Hi can multiple gmail accounts link a single custom email? For example: Student A has already linked the custom email to their gmail account, can Student B, C, and D still be able to link the custom email to their OWN gmail account? Regards!
November 06 2020
Hey Eric. That would depend on gmail. We don't have any restriction on it, just like you can login on multiple clients at once - but gmail may not allow the same email to be connected to more than 1 gmail accounts.
September 04 2020
How to check emails received on custom email?, it does not exist.
November 11 2020
Hey Sumit. You can check your emails via our webmail.
November 03 2020
It is working fine. But it is landing in the spam folder of the recipient. Can you suggest how do we avoid that? What SPF and DKIM should we use so that it is compliant and mail gets delivered to the inbox?
February 02 2021
Hi there! First things to do would be making sure you have both DKIM and SPF records added and propagating well. You'll find a full guide on how to set it up here :)
January 10 2022
Wow! Thank you! I continuously needed to write on my blog something like that. Can I implement a portion of your post to my site?
January 11 2022
Hi! You can quote any source on the Internet (including us) as long as you give credit and link back to the original source :)
September 15 2022
I have configured SMTP for the Gmail Server. It is functions well when the user email is yahoo address. However gmail addresses are unable to send email. I don't know why!
September 16 2022
Hey there! There could be quite a few reasons for that, and they would require a bit more information, so please contact your hosting provider for a more accurate answer regarding this issue, so you could send your emails to Gmail users.