SMTP Settings
Last updated
Last updated
By default, WordPress uses the PHP Mail function to send emails. However, it is better to use SMTP as it handles sending messages better and you can also use it to send emails from a third-party mailing service. Most WordPress hosting companies do not configure it properly, and some simply disable it to prevent abuse. As result, you and your customers will not get emails.
SMTP stands for "Secure Mail Transfer Protocol" and is pretty much the standard way to send emails. Sending emails requires logging into the mail server, which prevents abuse of the hosting server and improves email delivery.
Most WordPress hosting companies offer free business email addresses that can be used with own domain name. It is recommend setting up a separate email address for WordPress site. It can be anything like support@example.com or info@example.com.
For a small business website or a blog, it is fine to use the hosting provider’s SMTP servers. On the other hand, for an online store, then emails become mission-critical for business.
Third party SMTP service providers specialize in sending large volumes of email securely without triggering spam filters. We recommend using SendLayer, Sendinblue, or SMTP.com for most online businesses.
This WP Mail SMTP plugin allows to send WordPress emails via SMTP by entering SMTP credentials. WP Mail SMTP is the most popular SMTP solution for WordPress, currently used by over 3 million websites.
To install the plugin, go to Dashboard and find the Plugins section from the left menu and choose Add New:
You need to search WP Mail SMTP, install it, and activate it on the opened page:
Upon activation, the setup wizard appears that can be skipped to set up WP Mail SMTP manually.
Next, through the Dashboard > Settings > WP Mail SMTP plugin settings configured:
WP Mail SMTP should be configured and the settings are similar for all Hosting companies:
From Email – The email address that will be used to send all WordPress emails.
From Name – The name that emails are sent from. It is recommend website’s title as from name.
By default, WordPress uses "WordPress" as the sender name for all outgoing WordPress notification emails. By enabling "Force From Email", "From Name" setting above will be used for all emails, ignoring values set by other plugins.
Return Path – The setting can be enabled to receive delivery notifications or bounced messages.
Mailer – Choosing the Default mode would send the messages using the PHP mail() function without SMTP authentication. The ‘Other SMTP’ can be selected to send emails using host’s SMTP server.
To continue using the host's SMTP server, Other SMTP should be selected and enter the SMTP server settings provided by the hosting company. Once Other SMTP selected as mailer, a new section will appear with additional SMTP settings to configure:
SMTP Host – This is the SMTP host address provided by hosting company.
Encryption – The encryption method used by mail server to send emails. Usually, it is TLS.
SMTP Port – This is the port used by the outgoing mail server.
Auto TLS – This setting should be set to On
Authentication – Needs to be On
SMTP Username – This is usually the email address that used to send emails
SMTP Password – This is the password for the email account used to send emails.
WP Mail SMTP plugin settings vary for different hosting companies:
Following SMTP settings can be used to connect WP Mail SMTP to the Bluehost SMTP server:
SMTP Host – mail.example.com
Encryption – TLS
SMTP Port – 587
SMTP Username – Your email address (e.g. wordpress@example.com)
SMTP Password – Your email account password
Don’t forget to replace example.com with your own domain name.
Note: The Other SMTP mailer is less secure than other mailer options in WP Mail SMTP because it stores your email login and password in your WordPress dashboard. Other WordPress administrators have access to this, so whenever possible, we recommend using one of WP Mail SMTP’s more secure mailers such as SendLayer, Sendinblue, or SMTP.com.
Additionally, many hosting providers block their SMTP ports by default, which prevents an SMTP connection. In such cases, you’ll have to contact your web host to see if anything can be done to fix the issue.
Some managed WordPress hosting companies do not offer email services as part of their hosting plan. In this case, you will need to use a third party SMTP service provider to send email messages.
WP Mail SMTP supports several popular email services including Gmail/Google Apps for Work, Microsoft Outlook and Office 360, Sendinblue, SMTP.com and more.
Just click on a mail service and the plugin will show you the information you need to use that mail.
Once you install WP Mail SMTP, navigate to WP Mail SMTP > Settings in your WordPress and select Google / Gmail as Mailer:
Once Google / Gmail is selected as Mailer, a new section titled Google / Gmail appears. In this section, there are settings labeled Client ID and Client Secret:
Google / Gmail requires a Client ID, Client Secret and Authorized redirect URI. To generate the information for these fields, using a Google account is required to create a web application. This process doesn’t require any coding, and we’ll show you exactly what to do in the next step.
Log in to your Google account by opening a new tab or window and opening your Google Cloud Console.
Note: Before continuing, be sure to sign out of all other Google accounts besides the account you’ll be using for the SMTP setup.
Also, if you’re using Google Workspace, make sure that the Google account you use has permission to send emails (in other words, access to its own inbox).
When Google Cloud Console used for the first time, popup window may appear asking you to select your country and agree to the Terms of Service. Go ahead and do so, then click on AGREE AND CONTINUE to move on to the next step.
Next, we need to select a project to use for our application. We can choose an existing one or create a new one. To do this, click the Projects tab at the top of the toolbar.
In the opened popup, select an existing project from the list or click on New Project in the top right corner.
Set desired values for new Project Name, Organization and Location and click Create.
Then, in Google Cloud Console sidebar, go to APIs & Services > Library to enable the Gmail API for your project.
Enter “Gmail API” in the search field:
Click on the Gmail API result:
On the Gmail API page, click on the blue ENABLE button:
After enabling the Gmail API, you should be redirected to the Gmail API Overview page. Here, click on the CREATE CREDENTIALS button:
Select Gmail API from the drop down and and the User Data option before clicking Next:
You will then be asked for some basic information about your app.
This information will not be shown to the public and it will be only for personal use. Fill in the following fields:
App name – enter an app name of your choice
User support email – select your email address from the choices provided
App logo – you can upload a logo for the app, but it is not required
Developer contact information – fill in your email address again Click Save and Continue to proceed.
You can skip setting Scopes, so just click Save and Continue again:
On the next page select Web App from the dropdown menu, which should make a new field Name appear. You can keep the default suggested name. Scroll down to Authorized Redirect URIs and click Add URI. In the filed that appears input:
and click Create.
Once app has been created, the Your Credentials section will expand to show you your Client ID.
There’s no need to copy it now, as you’ll access it from another area in a later step.
Your app will be created in Internal mode by default. In order to use it properly you need to set it to External and publish it. To do that, in your Google Cloud Console sidebar, go to APIs & Services > OAuth consent screen. In the popup window that appears, select the In production option. Then click on CONFIRM.
Once confirmation is complete, you’ll see that your app’s Publishing status is now In production.
Next, click on Credentials in the left side menu. Under OAuth 2.0 Client IDs section you can see the details of the web application you just created.
This will open all of the details for your app.
On the right side of this page, you’ll see the Client ID and Client secret values.
Copy the values of the Client ID and Client Secret and paste them in the corresponding fields in the WP Mail SMTP plugin Settings page:
Be careful not to copy any blank spaces as this will show an error on the next steps. Click Save Settings.
Once the page refreshes, scroll down and click the orange Allow plugin to send emails using your Google account button:
You might see the following screen if you are connecting with a free Gmail account. Go ahead and click on the Advanced link in the bottom left corner.
In the expanded section, click on Go to wpmailsmtp.com (unsafe). Don’t worry, Google only displays this warning because it hasn’t verified your app. There is no need to verify it since you created this app just for your own use.
This will ask you to sign in to your Google account and allow wpmailsmtp.com to access your Gmail email. Click Allow to proceed:
If you have done all of the above steps correctly you will be returned to the WordPress WPMail SMTP plugin’s Settings page and a notice saying “You have successfully linked the current site with your Google API project. Now you can start sending emails through Gmail.” will be present.