How to Use the Gmail SMTP Server to Send Emails from WordPress

While different website builders have different ways of sending emails, most allow you to send them without issue… but sometimes, WordPress can be a bit of a pain when it comes to sending messages from your site.

Sometimes you need that extra bit of control over your emails, or sometimes your WordPress host doesn’t allow you to send emails through WP. Whatever the case, you can easily switch to Google’s SMTP server using a decent plugin.

WP Mail plugin

Pros and Cons of The WordPress Mailing System

We are not saying that the WordPress mailing system is useless. It’s just that it’s not as good as we’d like it to be. Let’s look at the Pros.

  • You will get a notification message when a new user registers on your website.
  • You will be notified of any password reset.
  • You will get a report on updates.
  • You will receive messages from your contact page.

Now, let’s see the Cons.

  • It’s not 100% effective in delivering emails.
  • Most hosting providers apply restrictions to WordPress mailing service because it’s prone to abuse (e.g. spamming and hacking).

Since Spam apps filter emails if they are coming from reputable mail servers, messages from WP’s internal mailing system can get blocked.

Your Options When Choosing the Best Mailing Service for Your WordPress Site

  1. Gmail SMTP – We already told you why this mailing system is better than the WordPress built-in mailing system (it’s more secure).
  2. Bulk Email Service Provider – You can get the services of popular apps like MailChimp, SendGrid, MailGun, SendBlaster, etc. Most of these companies have free trials – after which, you will have to pay (if you want to continue your account).
  3. Hosting Companies’ Email Service – Most hosting companies email services are free. Some even allow you to have numerous email accounts.

Free Gmail or Paid Gmail SMTP?

As you can already tell, we are recommending Gmail SMTP service because it’s secure and functional. Well, you know how Google is – Google has never failed us, especially when it comes to web security. So, we’ll just tell you more about Google SMTP in this section.

Please know that you can use Google SMTP for free. However, while their free service is as secure as their paid service, the free service carries limited features and limited memory. Therefore, you can choose the free service if your requirements and needs are minimal.

Should you decide to go for the paid Gmail SMTP service, you will be given your own branded email address such as your-name@your-site.com. See, it would seem that the email was sent by your website – and that would make it look professional and credible. By the way, their paid service is called Google Apps for Work.

How to Use Google Apps for Work

Here are the steps to using paid Gmail SMTP (Google Apps for Work):

  1. Go to Google Apps for Work website and click the Get Started button. At this point, you’d want to connect your website to your Google account.
  2. Fill up the form if you already have a domain. If you don’t have a domain yet, you can click on the buy domain option. You can also buy your domain outside the Google platform and just return to their site when you already have one.

Note: When you create your Google Apps for Work account, you will also be asked to pick a business email address. You are also required to have a username and password – so, do prepare in advance for those things.

  1. Click Accept for the Terms of Agreement.
  2. Click Sign Up button

How to Set Up WordPress Dashboard Plugin

You also need to prepare your WordPress because you will use it when sending emails using SMTP. So, here are the steps you need to do:

  1. Go to your WordPress Dashboard and click on the Plugins Section.
  2. Search for WP Mail SMTP (it’s free) and install it on your WordPress.
  3. Now, go to your installed Plugins page and activate the WP Mail SMTP.
  4. Go back to your Dashboard Home and click on Settings. You will see WP Mail SMTP under Settings – click on that.
  5. Fill up the form. Place the Gmail address you’re using for your business on the From Email. Then put your name (business name) on the From Name.

You now need to connect your website to Google’s mail servers. There are actually 2 ways to do this. See your options below.

  • Through OAuth Authentication Protocol
  • By manually inputting information on Google’s SMTP settings.

We’ll discuss both in the next sections.

Option #1 – Through OAuth Authentication Protocol

First, we need to set up your Gmail and WordPress accounts so that your emails are sent through the OAuth Protocol. Follow the steps below.

  1. For the Mailer option, click on Google.
  2. Click on the box (to check it) that says “set the return path to match the from email.”
  3. At this point, you need to fill in the Client ID, Client Secret, and URL (Authorized Redirect URL field). Since we don’t have them yet, additional steps are required – so, just keep following the steps below.
  4. Search Google for “Google Developers Console.” Click on the link to end up on their website’s platform.
  5. Click on the Create Project button.
  6. Assign a name for your project. It could be something like WordPress Email Campaign. In this case, your project ID will be wordpress-email-campaign.
  7. Click the Create button.
  8. Google Developers Console will take you to its Dashboard. Click on the “Enable APIs and Services” button. This step is necessary as you need an API to complete the steps required in using OAuth Protocol.
  9. When you get to the API’s Library, you will see a search box there. Type Gmail and wait for the result. You will get 1 result, and that will be your API.
  10. Click on the Enable button.

Note: At this point, you have already activated your API. However, we are not through yet, since you still need to create your credentials for your WordPress Plugin. So, proceed to the next steps.

  1. Click on the Create Credentials button.
  2. For the “Where will you be calling the API from” question, click web browser (Javascript).
  3. For the “Which API are you using” question, click Gmail API.
  4. For the “What data will you be accessing” question, click on User Data.
  5. Continue through the pages by clicking “What credentials do I need?”

Note: our next steps will allow us to get a Client ID.

  1. While still in the Dashboard’s Credential section, fill in the required fields. For the name, it can be anything – for example, “WordPress EMail Campaign.”
  2. For the “Authorized Javascript Origins” field, type in your domain name there (e.g. www.your-domain.com).
  3. “For the Authorized Redirect URLs” field, you will find that in the WP Mail SMTP plugin’s settings. Just copy-paste the details there into the blank field.
  4. Click on the Create Client ID button.
  5. When the “Set Up the OAuth Consent” screen comes up, put your email address on the space provided.
  6. For the “product name shown to users,” you can just put in the name of the plugin that you’re using (e.g.WP Mail SMTP).
  7. Click on the Continue button. Doing so will allow you to get your Client ID – which is needed in your WP Mail SMTP plugin’s settings.

Note: You still need Client Secret Key to complete the setup – so, just keep on going with the steps.

  1. Click the Done button.
  2. You will see your project’s own credentials. Click the edit tool (pencil) at the lower right corner of the page. This will take you to the editing area of your credentials – and there you will find your Client Secret Key.
  3. Copy the Client Secret Key and paste it on your WordPress WP SMTP settings section.
  4. Click on the Save Settings button once you fill-up the Client ID and Client Secret Key.
  5. Scroll down the page until you reach the portion that says: Allow the plugin to send emails using your Google account. Click on that, and you will be taken to your Google account.
  6. In Google, you will be asked to give permission to your website so as to send emails for you. Click on the Allow button to confirm the said action.
  7. You will be sent to your own website and you will see a success message.

Note: That’s it, you have completed all the steps required to use the OAuth Protocol.

Option #2 – Manually Set Up Gmail SMPT as Your WordPress Email Sender

With this option, you can skip all the steps above (if you were to use Option #1). This time, only a few steps are involved to set everything up. See the instructions below.

  1. In your WordPress Dashboard, go to Settings and open the WP Mail SMTP page.
  2. For the From Email field, put in the Gmail address you want to use in this particular project.
  3. For the From Name field, fill it up with your name, alias or pseudonym.
  4. For the Mailer portion, click on Other SMTP.
  5. Click on the box next to “Set the return path to match the From Email.
  6. Below is a list of configurations needed for the setup.
  • SMTP Host: smtp/gmail.com
  • SMTP Port: 464
  • Encryption: SSL
  • Auto TLS: Off
  • Authentication: On
  • SMTP Username: your gmail address or website email address.
  • Password: Your gmail email password.
  1. Click Save.

There, you have completed the setup process to use Gmail SMTP servers in sending emails from your WordPress.

How to Check if the Setup is Correct

Just to make sure that ALL your settings are correct, you should run a test email as soon as you’re through with the setup. Follow these steps:

  1. Go to your WordPress Dashboard, click on Settings, then click on WP Mail SMTP.
  2. On the WP Mail SMTP menu, click on the tab that says “email test.”
  3. Write a test email to one of your email addresses.
  4. Click Send.
  5. Check to see if you received a success message like “your email was sent successfully.”
  6. Open the email address where you sent the test email and check if you received the email.

Troubleshooting Tips

In our experience, both options work in sending emails through WordPress using the Gmail SMTP servers. There are a few instances, however, where any of the 2 may not work properly – resulting in undelivered emails. This often happens to shared hosting accounts – just so you know.

Troubleshooting Tip #1 – Creating a dummy email account is one of your options. Follow the steps listed below.

  1. Log into your hosting provider’s cPanel.
  2. Create an email with the same name as your Gmail.
  3. To check if the technique worked, send a test email to yourself.

Note: What we hope to accomplish here, is to somewhat fool your host’s server that your emails are handled by their servers. It’s a long shot, but this technique can sometimes work.

Troubleshooting Tip #2 – Editing your MX Records. The steps to doing this are listed below.

  1. Log into your cPanel.
  2. Look for the MX Records file because you need to change its routing settings from automatic to remote.
  3. Send a test email to yourself to see if it worked.

Which Option is the Best for You?

In our opinion, using the OAuth Protocol would be the better choice than manually setting up Gmail SMTP. Yes, the OAuth method requires a lot of steps – but that’s because it uses a secured platform.

As for the option of manually setting up your WordPress to work with Gmail SMTP – we really think it’s quite risky. You will be entering an unsecured environment and also expose your followers/ readers/ visitors to the same atmosphere. So, although the steps involved here are fewer and simpler than if you were to use the OAuth Protocol system, we really don’t recommend it.

Leave a Comment

Your email address will not be published. Required fields are marked *