How To Send Email in WordPress Using Gmail SMTP Server

 Are you having trouble sending emails from your WordPress site?

Are you unable to send emails from your WordPress site?

How To Send Email in WordPress Using Gmail SMTP Server



An easy way to solve this problem is to use the Gmail SMTP server to send WordPress emails.

In this article, we will show you how to use the Gmail SMTP server to send emails from a WordPress website.



1.Why the When and by You Need Gmail SMTP Server for WordPress Emails:


Your WordPress site sends emails to notify you of new user registration , lost password reset , automatic updates, and even notifications from your contact forms .

By default, WordPress uses the PHP mail function to send out email notifications. However, this function doesn't work as expected due to a number of reasons.

Most WordPress hosting companies restrict usage of this function to prevent abuse and spam.

Spam filters on popular email service providers check incoming emails to monitor if they are sent from authentic mail servers. Default WordPress emails fail this check and sometimes may not even make it to the spam folder.

SMTP (Simple Mail Transfer Protocol) is an industry standard for sending emails. Unlike the PHP mail function, SMTP uses proper authentication, which can improve e-mail deliverability.

Gmail provides an SMTP service, which you can use to send emails from your WordPress website. If you only want to send WordPress notification emails to yourself and a few users on your site , the Gmail SMTP server is the best choice.

However, if you plan to use WordPress to send newsletter emails , you should use a popular email service provider, such as Sendinblue or Mailgun.


2.WordPress Free vs Paid Gmail SMTP service:

You can use your free Gmail account to send out WordPress emails. However, for better deliverability, we recommend using paid G Suite .

With G Suite, you get your own professional branded email address such as (name@yoursite.com).

G Suite requires you to add MX records to your domain name which means that your emails will appear to be coming from your own domain name boosting authenticity and ensuring better deliverability.

We use G Suite for WPBeginner, which can be said to be the best.


3.How the Send Email to a using Google SMTP the Tutorial Video:

Demo address

If you prefer written instructions, then please continue reading.


4.How to use Gmail SMTP server to send e-mail WordPress:


If you decided to use G Suite , then you first need to set up your domain to work with Google Apps. We have a step by step tutorial on how to set up a professional email address with G Suite .

Regardless of whether you use a paid or free Gmail account, the rest of the instructions are the same.

The first thing you need to do is install and activate the WP Mail SMTP plugin. For more details, see our step -by- step guide on how to install a WordPress plugin .

WP Mail SMTP is the best WordPress SMTP plugin on the market. It allows you to easily use any SMTP server to send WordPress emails with higher deliverability.

We recommend that you purchase the paid version called WP Mail SMTP Pro , which allows you to use advanced support, more mail programs, and white gloves set up by one of its experts.

After activation, you need to visit the Settings»WP Mail SMTP page to configure the plugin settings.

WP Mail SMTP Settings

First, you need to make sure to use a Gmail email address in the "From email" field. Next, you need to provide the name of the sender.

The WP Mail SMTP plugin provides two ways to connect a WordPress website to a Gmail server.

The first method uses OAuth authentication. This is a safer way to send emails using Gmail server.

The second method is to manually enter the Gmail SMTP settings. This method is not recommended because of its low security.

That being said, let's set WordPress to use Gmail SMTP to send emails.


Method 1: Set WordPress Gmail to send email using the OAuth protocol: 

This method is recommended for all users. It is more secure and once you set it up, you'll never have to do that again.

First, you need to select Gmail as the mail sender and set the return path to be the same as the sender.

Select Gmail and set return path


Next, you will see the option to enter the client ID, client secret, and URL in the "Authorized Redirect URI" field.

Let's set these fields.

Gmail API to create applications and generate keys for Creating AN App and the Generate API Keys for Gmail :

Visit the Google Developers Console website and create a new project.

Create a new Google Developer Console project


If you don’t see the blue button to create a project, you can also click the Select project drop-down menu and create a new project.

You'll be asked to provide a name for your project. Give it a memorable name, so that you can easily recognize it in the future.

Name your project


After that, click on the create button to continue.

Developer console will now create your project and take you to its dashboard. Google offer developers access to many of their APIs and services. You need to enable the APIs that you will be needing for this project.

Enable APIs


Click on Enable APIs and services button to continue.

This will bring you to the APIs library page. Next, you need to type Gmail in the search box to quickly find the Gmail API and click to select it.

Select Gmail API


You will now see an overview of the API and what it can do. Simply click on the'Enable' button to continue.

Enale Gmail API


Now that your API is enabled, the next step is to create credentials that can be used in the WP Mail SMTP plugin settings.

Click the Create Credentials button to continue.

Create credentials


The Next Screen at The ON, by Will you need to the SELECT 'Web Browser JavaScript' in 'the Where you'll BE Calling at The API from' Field,. The After that the Click ON at The 'the Data the User' the Option.

API credentials step 1


To continue, click on the'What credentials do I need?' button.

You will now be asked to provide the name of the OAuth client name. You can enter "WP Mail SMTP" here.

API Credentials step 2


Under JavaScript origins field, you need to add your website's domain name. Next, you need to copy and paste the authorized redirect URL from WP Mail SMTP plugin settings.

After that, click on the'Create client ID' button to continue.

Next, you need to enter a name for OAuth consent screen. You can put the plugin's name here.

Ouath consent screen


After entering the details, click on the continue button and the developer console will show your client ID. You can copy and paste this in the WP Mail SMTP plugin's settings page. However, you will still need to add your client secret key.

Getting your client ID


Go ahead and click the "Finish" button to continue.

You will now be taken to your project's credentials page. On this page, you can see your recently created credentials listed here. You need to click on the edit icon next to your credentials to continue.

Edit credentials


This will bring you to the edit credentials page where you will be able to see your client secret key. You need to copy and paste the key in your plugin's settings page.

Client secret key


Return back to plugin's settings page in your WordPress admin area. Now that you have both client ID and client secret keys, you need to click on the save settings button to continue.

Save client credentials in plugin settings


The plugin will now store your settings and reload the page. After that, you need to scroll down to the bottom of the settings page and click on the'Allow plugin to send emails using your Google account' button.

Allow plugin to send emails


This will take you to your account on Google, and you will be asked to give the website permission to send emails on your behalf.

Allow Gmail


Click on the Allow button to give permissions.

After that, you will be redirected back to your website where you will see a success message.

Connected successfully


Method 2: A Gmail SMTP SMTP to the sender: 

This method allows you to manually connect to Gmail's SMTP servers to send your WordPress emails.

First, you need to visit the Settings»WP Mail SMTP page to configure the plugin settings.

You need to start by providing the Gmail address you want to use in the'From Email' field, and your name in the From'Name' field.

Gmail SMTP


Next, you need to select'Other SMTP' as your mailer and check the box next to return path.

After that, scroll down to the Other SMTP section to configure more settings.

Gmail SMTP settings for WP Mail SMTP plugin


Here is the exact configuration you need to add in the plugin settings:

  • SMTP Host: smtp.gmail.com

  • SMTP Port: 465

  • Encryption: Use SSL encryption

  • Authentication: Turn on authentication

  • Username: Your complete Gmail address, eg john.smith@yourdomain.com or john.smith@gmail.com

  • Password: Password of your Gmail account

Once you are done, click on the save changes button to store your settings.

That's all, you have successfully set up WP Mail SMTP to use Gmail SMTP servers.

That's it, you have successfully set up WP Mail SMTP to use the Gmail SMTP server.

Note: If you use method two, please note that it is less secure because your password is stored in text form. You can use the constant tip to enhance this effect, but we strongly recommend that you use method 1.

Test your WP Mail SMTP settings:

WP Mail SMTP plugin allows you to test your email settings, so you can make sure that everything is working properly.

The WP Mail SMTP plugin allows you to test your email settings, so you can make sure that everything is working properly.

You need to visit Settings »WP Mail SMTP page and click on the'Email Test' tab. Simply provide an email address that you can access in the send to field and click on the send email button.

Send test email


You will see a success message. Now you can check your inbox to see the message with the subject "WP Mail SMTP: Test Email to...".

That's all, you have successfully setup your WordPress site to send emails using Gmail SMTP servers.

That's it, you have successfully set up your WordPress website to use the Gmail SMTP server to send emails.

Use WP Mail SMTP Pro to get more WP Mail SMTP Pro:

If you want even more functionality, you should try WP Mail SMTP Pro .

With the Pro version of the plugin, you can connect with:

Using the professional version of the plugin, you can connect:

  • G Suite/Gmail

    G Suite / Gmail
  • Amazon SES

    Amazon SES
  • Mailgun

    Mailgun
  • Office 365 / Outlook.com

    Office 365 / Outlook.com
  • SendGrid

    SendGrid
  • And more

    And more

You also get additional features like email logs, ability to fine-tune / control which notification your WordPress site sends, and more.

Gmail SMTP does not work for troubleshooting:

We have seen users encounter few issues when using Gmail SMTP with certain shared hosting configurations.

We have seen that users have very few problems when using Gmail SMTP with certain shared hosting configurations.

Please follow the steps below to resolve Gmail SMTP issues:

  1. Log in to your cPanel account and create an email account that matches your Google apps email address. This might seem strange because you're not using your server for emails. This step tricks your server into believing that you're sending the email through the server.

  2. In your cPanel account, go to the MX Records and change the MX routing from automatic to remote. It might be a little tricky to find since each host now has a custom cPanel interface. You need to look for a small link next to MX that says Email Routing: Remote Mail Exchanger.

  3. After that log back into your WordPress site and send a test email.

    After that, log in to your WordPress site and send a test email.

We hope this article helped you learn how to send email in WordPress using the Gmail SMTP server. You may also want to see our list of the best contact form plugins for WordPress , and our comparison of the best email marketing services for small business.


Post a Comment

Previous Post Next Post