How to Use a SMTP Server to Send WordPress Emails

If you are reading this then you must have encountered the terrible situation where you can’t send and receive your emails on your WordPress site. For this, you can either opt for third-party email services for which you will have to pay some extra amount or use the SMTP server for this task.

In many cases, your web host’s support can help you solve this type of issues. If you are not satisfied with the level of support offered by your current host, and are considering switching to a new web hosting service, consult with HostAdvice’s expert and user reviews on our Best WordPress Hosting Services page.

Why does this problem arise?

This problem is usually caused because of incorrect configuration of this function by most of the shared hosting providers. Sometimes this function is even completely disabled by them. Both of these cause this error.

You can use Mailgun, Google Apps for Work, Sendgrid, and many more third-party email services to send the emails if you face the error mentioned above. But these services will cost you and the cost will depend on the number of emails and user accounts.

But if you don’t want to pay any extra amount, we have got you covered. Because you are most probably already paying for it. Just go through the following tutorial and we will guide you how.

Use of the email accounts provided by your host

For each domain, you host with the WordPress hosting providers you are most probably offered email service. With the help of this feature, you can easily make email accounts that contain your own domain.

We are using cPanel for this tutorial however the process remains same for most of the service providers.

First of all you need to log-in to your hosting account. Then under the Email section look for the Accounts option. Then click on it.

Once you have clicked on the Accounts option you will be presented with a form which will look like any regular form which is required to be filled while creating an email account.

The first field to be filled is Email. We recommend you to choose an email like This will look a bit professional.

After filling all the details click on the Create Account button. This will create your email account. But before using it you need to get some information from your service provider. Here is the list:

  1. SMTP host of your email address.
  2. SMTP port for secure login.

Use of custom email address

Look for the Wp Mail SMTP plugin. Install and activate it. Once you have successfully activated the plugin, navigate to Settings and then click on Emails in your WordPress dashboard.

Here you will find empty boxes saying ‘From Email’ and ‘From Name’ which you will need to fill. In the first box write the email address that you recently created. And in the next field type the sender’s name or the name from which the emails are being sent.

In the Mailer section, you will be given various options. Choose the one that reads ‘Other SMTP’. Then, against the Return Path option, click on the checkbox that reads ‘Set the return-path to match the From Email’. It will set the return path as to match the email address of the sender for you. Checking it is very important or you will end up losing the bounced messages and non-delivery receipts.

Once you have successfully done all the things mentioned above you need to set up the SMTP options.

You will again be presented with a form here.

Generally, the SMTP host is and SMTP Port is 465. But if it isn’t the case with you, you will have to get this information from your hosting provider.

If the TLS option is available, go for it. Then there will be a toggle against the Authentication option. Turn it on. You will then be asked for your SMTP username and password. In the most cases, your SMTP username is your email address. You may feel that the plain text password here isn’t safe. We will work that out later on.

After filling all the required details, click on the button that reads ‘Save Settings’.

Time to test the settings

Once you have done all the things mentioned above, your WP Mail SMTP will be configured to send emails. So, as we have configured the WP Mail SMTP to send emails, we would like to check if everything goes smooth or not.

Go to the plugin and then visit the settings page. In there you will find the tab that reads ‘Email Test’. You need to click on it. Once you have clicked on it, you will be taken to a new tab wherein you will see an option ‘Send To’. Fill the email address where you want to receive the test email. Then click on the button at the bottom that says ‘Send Email’.

A success message will be shown to you as soon as the email is delivered to the entered valid email address.

Making the password of your email more secure

As we discussed earlier, the password that you entered in WP Mail SMTP may not seem secure to you. Actually, it isn’t. As it is stored as a plain text. But do not worry. We will make our way out here.

Open your FTP client or the file manager app in cPanel and then connect to your website. Open the root folder of your website. Look for the wp-config.php file in there. Once you have found the file, you need to edit it by using any plain text editor. You can use Notepad or TextEdit or any other plain text editor.

In the file, you need to look for the line ‘That’s all, stop editing! Happy blogging’. Once you are able to successfully locate it, you have to add the following code just above this line after swapping the ‘your_password’ by your SMTP password.

define( 'WPMS_ON', true );
define( 'WPMS_SMTP_PASS', 'your_password_here' );

Next, you will have to upload this file back to the server once you are done editing and saving the file.

If you want to check the result you need to go to Settings and then navigate to the  WP Mail SMTP in the WordPress dashboard. If you notice, the box against SMTP Password under the SMTP options is disabled now which is more secure.

WordPress email issue troubleshooting

Always reassure if you have entered the correct SMTP host and SMTP port settings as per provided by you hosting provider. We are telling you this because this can be a reason for any kind of error in sending emails with the use of SMTP in WordPress.

Also, you need to be very particular about entering the correct method for encryption. There is not much problem with SSL in most of the case but it is always better to check with your web hosting provider in case there is any kind of problem in the delivery of your emails.


Check out the top 3 WordPress hosting services:

Was this article helpful?