How to Setup and Configure SMTP on WordPress via Cloudways

by Mustaasam Saleem  February 8, 2017

Email, the short form of Electronic Mail is the term used when a message is distributed by using an electronic medium from one computer user to another or many recipients. WordPress is one of the most popular CMS in the world. While you are working on WordPress, you might want to send out emails to your clients and customers using a different email address other than the default email address. To achieve that, you need an email account and an SMTP service that will connect your server and application and allows you to send out emails.

Setup SMTP on WordPress

Today, I am going to guide how you can setup an SMTP service on WordPress via Cloudways SMTP Addon. It will only take a few minutes of your time, and before you know it, you will be done and sending out emails to your customers around the world.

What is SMTP?

The term SMTP stands for Simple Mail Transfer Protocol. It is a service used to send out emails from a client to a server or in-between email delivery among different email accounts.

As far as WordPress is concerned, I believe that SMTP is a good alternative to PHP mail function. It can be used to receive emails submitted via the contact us form, password reset emails and much more. In my example, I will be using Gmail SMTP on WordPress. However, the steps will be more or less the same, if you go with some other SMTP provider.

Prerequisites:

Before setting up SMTP, you need to read these precautions carefully.

  • If you have enabled Two Factor authentication on your Gmail account. You need to generate a special password and note it down as it will be required for different password fields. Here is the step by step guide on how to generate an app password.
  • If you have not enabled the Two-Factor authentication, then you just need to allow access to less secure apps from here. Just click on the Turn On button.

So without further ado, let’s setup SMTP on our Server first.

First of all, you need to authorize your server to access your Gmail account. If you have merged more than one account on Gmail, Login with the main account and open this link, and click on “Continue”.

Subscribe To SMTP Addon From Platform

By default, WordPress uses PHP mail function to send emails. To setup SMTP on your application, you need to enable the add-on from the platform so it can handle SMTP requests coming from an application right away. To subscribe, you simply have to follow these simple steps:

Login to your Cloudways account, and click on the square boxes located on the top admin bar of your hosting platform and then select Add-Ons. It will direct you to a new screen which contains all server add-ons, locate SMTP Add-on label, click on the pencil icon and then click on the Subscribe button. This will enable the addon throughout the server.

SMTP Addon - Cloudways

Configure SMTP Addon on Server

Once, you have successfully subscribed to SMTP add-on, navigate to Servers tab from the top left corner of the top admin bar and get into your server. From the left pane, go to Add-Ons tab, and you can now see that the SMTP addon is enabled.

SMTP Addon Configurations - Cloudways

To configure the SMTP addon, click on the Edit Details button. It will ask you to select the SMTP provider. In my example, I will use Gmail SMTP to connect my WordPress with the server and here are my configurations:

  • Provider: Custom SMTP
  • Host: smtp.gmail.com
  • Port: 587
  • Username: My Gmail Email ID
  • Password: My Gmail Password (or App Generated Password)

SMTP Addon Configuration - Cloudways

That’s all you have to do through your hosting platform to connect your Gmail SMTP Addon with your WordPress application. If you are interested in gaining an in-depth understanding, here is an awesome guide equipped with FAQs.

Why Should You Use SMTP on WordPress Separately?

Since all the applications on server use this default SMTP setting. So, You might need to set up separate email configuration in other applications. For this, you can enter your custom details in a WordPress plugin which will override the default SMTP settings and send emails using your customized settings.

Configure SMTP on WordPress

We are now done with setting up the addon successfully to create an active communication channel between SMTP provider and all applications. Let’s move ahead to the next step of learning how SMTP can be enabled on your WordPress application separately.

First of all, you need to install an SMTP plugin from WordPress dashboard. You can find many SMTP plugins in the WordPress plugin repository. However, in my example, I will be using one of the most popular plugin known as the “WP Mail SMTP” plugin. It inquires you to fill up the following attributes:

  • Specify the name and email address for outgoing email.
  • Choose to send mail by SMTP or PHP’s mail() function.
  • Specify an SMTP host (defaults to localhost).
  • Specify an SMTP port (defaults to 25).
  • Choose SSL / TLS encryption (not the same as STARTTLS).
  • Choose to use SMTP authentication or not (defaults to not).
  • Specify an SMTP username and password.

As soon as you install and activate the plugin, you will see a new label titled “Email” right underneath the Settings.

WP Mail SMTP

There are three steps for setting up this plugin. Let’s cover these steps one by one.

1. Advanced Email Options:

This tab includes the following settings for emails.

  • From Email: It is the email address that allows emails to be sent from. This is useful if your Gmail account is merged with more than one account. If you leave it blank, the default email address will be used.
  • From Name: The name of the sender. Usually, it is the website/company name.
  • Mailer: You can specify which service is to be used for sending out emails. As we are using an SMTP service other than the server, that’s why we have chosen to send all WordPress emails via SMTP.
  • Return-Path: Mark this, if you want to get replies to the same email listed in from email text field.

Advanced Email Options - WP Mail SMTP

2. SMTP Options:

The SMTP options allow you to enter custom SMTP details. The labels and text fields may include:

  • SMTP Host: The host name of your SMTP provider, in my example its smtp.gmail.com
  • SMTP Port: The port that will be used: 587
  • Encryption: The Port 587 refers to TLS connection. So, mark “Use TLS connection”.
  • Authentication: Use SMTP authentication as I am connecting my Gmail account.
  • Username: The Email address that will be used to send emails.
  • Password: The password of above entered email or App generated password if you have enabled Two Factor.

SMTP Options - WP Mail SMTP

3. Send a Test Email:

Once you have successfully installed and configured SMTP on WordPress, we will now move ahead to the testing stage. Let’s see how the results look like. Simply, enter an email and hit the Send Test button. And I’m sure; you will get the email 😉

Test Email - WP Mail SMTP

And that’s all! But, before we move to the end of this article, let me assure you that Gmail for FREE restricts you to send only 500 emails or 500 recipients per day. If you want more, then try using any other premium SMTP provider like Elastic Email that has fewer limitations. The steps are the same as above for other providers, and you just need to configure the settings as per the SMTP provider. If you have any query or stuck in any step. Feel free to comment below, and I would love to help you out.

Start Creating Web Apps on Managed Cloud Servers Now!

Easy Web App Deployment for Agencies, Developers and E-Commerce Industry

About Mustaasam Saleem

Mustaasam is the WordPress Community Manager at Cloudways - A Managed WordPress Hosting Platform, where he actively works and loves sharing his knowledge with the WordPress Community. When he is not working, you can find him playing squash with his friends, or defending in Football, and listening to music. You can email him at mustaasam.saleem@cloudways.com

Stay Connected:

You Might Also Like...