WPBeginner

Beginner's Guide for WordPress

  • Blog
    • Beginners Guide
    • News
    • Opinion
    • Showcase
    • Themes
    • Tutorials
    • WordPress Plugins
  • Start Here
    • How to Start a Blog
    • Create a Website
    • Start an Online Store
    • Best Website Builder
    • Email Marketing
    • WordPress Hosting
  • Deals
  • Glossary
  • Videos
  • Products
X
☰
Beginner's Guide for WordPress / Start your WordPress Blog in minutes
Choosing the Best
WordPress Hosting
How to Easily
Install WordPress
Recommended
WordPress Plugins
View all Guides

WPBeginner» Blog» Tutorials» How to Use SMTP Server to Send WordPress Emails

How to Use SMTP Server to Send WordPress Emails

Last updated on December 20th, 2017 by Editorial Staff
269 Shares
Share
Tweet
Share
Pin
Special WordPress Hosting offer for WPBeginner Readers
How to Use SMTP Server to Send WordPress Emails

Are you having trouble receiving or sending emails from your WordPress site? One solution for that is to use third party email services such as Mailgun. However, these services will cost you extra money. In this article, we will show you how to use a SMTP server to send WordPress emails.

Using SMTP Server to Send WordPress Emails

The Problem with WordPress Emails

WordPress uses mail function in PHP to send emails. Many shared hosting providers do not have this function configured properly, or they have disabled it entirely to avoid abuse. In either case, this causes your WordPress emails to not be delivered.

The alternative solution is to use a third party email service to send out your emails. You can use services like Mailgun, Google Apps for work, or Sendgrid.

You will have to pay for your account, and the cost will vary depending on how many users/accounts you add or the number of emails you send. See our tutorial on how to fix WordPress not sending email issue.

What if we told you that there is another option, and most likely you are already paying for it?

Using Email Accounts by Your Host

Most WordPress hosting providers offer email services for each domain you host with them. This means you can create email accounts with your own domain name like yourname@yoursite.com.

First you will need to create an email account. For the sake of this example, we will show you how to create an email account in cPanel. Your hosting service provider may use some other account management system, but the basic process is the same on most hosting services.

Log into your hosting account, and click on email accounts under the mail section.

Email accounts

This will show you a simple form where you need to fill out information required to create your email account.

Since we will be using this account to send WordPress emails, we recommend that you create an email account like wordpress@example.com. Make sure to replace example.com with your own domain name.

Creating email account in cPanel

After creating your email account, you are now ready to use it in WordPress. But before you do that, you will need the following information from your hosting service provider.

  1. SMTP Host for your email address.
  2. SMTP Port for secure login.

You can check the support section on your host’s website for this information. Most likely there will be an article providing this information. If you don’t find it, then you should contact the hosting support to request this information.

Using Your Branded Email Address in WordPress

You will now need to install and activate the WP Mail SMTP plugin. For more details, see our step by step guide on how to install a WordPress plugin.

Upon activation, you need to visit Settings » Email to configure the plugin settings.

WP-Mail-SMTP Settings

First you need to enter the email address you just created. After that you can add a from name, this will be used as the sender name.

If you do not add a from name, then the plugin will use the default WordPress.

Next, you need to choose the mailer. Go ahead and click on the ‘Other SMTP’ option to select it.

Choose Mailer

After that, you need to check the box next to ‘Return Path’ option. This option sets the return path to match the sender email address. If you leave it unchecked, bounced messages and non-delivery receipts will be lost.

Next, you need to set up SMTP options.

SMTP settings

First you need to enter your SMTP host and port. You can obtain this information from your hosting provider. Typically, SMTP host is mail.yourdomain.com (replace yourdomain.com with your own domain name). For SMTP Port 465 is commonly used.

Next, you need to choose encryption. Most WordPress hosting companies support SSL and TLS. We recommend using TLS option when available.

After that turn on the authentication toggle and provide your SMTP username and password. Normally, your email address is also your SMTP username.

Your password is stored as plain text, which is not safe. Don’t worry, we will show you how to make more secure later in this article.

Don’t forget to click on the save settings button to store your changes.

Testing Your SMTP Settings

Now that you have set up WP Mail SMTP to send emails, let’s test if everything is working fine. On the plugin’s settings page, click on the ‘Email Test’ tab.

Send test email

You need to provide an email address where you would like to receive test email. This could be any valid email address that you can access. After that click on the Send Email button to continue.

WP Mail SMTP will now send an email message using the SMTP settings you entered earlier. You will see a success message when email is sent successfully.

Securing Your Email Password

You may need to enter your email account password in WP MAIL SMTP settings. This password is normally stored as plain text which is unsafe.

However, the plugin also provides you an option to make it more secure. To do that, you will need to add some code to your wp-config.php file. If you haven’t done this before, then please see our guide on how to edit wp-config.php file in WordPress.

First you will need to connect to your website using a FTP client or File Manager app in cPanel. Once connected, you will find your wp-config.php file in the root folder of your website.

You can edit this file using any plain text editor like Notepad or TextEdit.

Locate the line that says ‘That’s all, stop editing! Happy blogging’ and add the following code just before it.

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

Don’t forget to replace ‘your_password’ with your actual SMTP password. After that, save and upload your wp-config.php file back to server.

You can now visit your WordPress admin area and go to Settings » WP Mail SMTP page. Scroll down to the SMTP options section and you will see password field is now disabled.

SMTP password disabled

Troubleshooting WordPress Email Issues

The most common reason for errors in sending emails using SMTP is incorrect SMTP host or port. Make sure that you are entering the correct host and port settings provided by your hosting provider.

Make sure that you select the correct encryption method. Usually SSL works on most environments, but we recommend that you check with your web host if your emails are not getting delivered.

Pros and Cons of Using Your Web Host’s Mail Servers for WordPress Emails

First and the most obvious advantage is that you can use your own branded email address for outgoing emails in WordPress.

Another advantage is that you have already paid for this service when signing up for your hosting account. You will not need to pay any extra money for sending and recieving emails.

However, some WordPress hosting providers enforce limitations on outgoing emails. This is why we don’t recommend using WordPress to send newsletter emails.

Another common problem with shared hosting providers is that their mail servers can be quite unreliable at times. If you notice delays in email delivery, then you should consider using third party email services like Google Apps for Work, Mailgun, or SendGrid.

We hope this article helped you learn how to use SMTP server to send WordPress emails. You may also want to see our list of the must have WordPress plugins for businesses.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

269 Shares
Share
Tweet
Share
Pin
Popular on WPBeginner Right Now!
  • How to Start Your Own Podcast (Step by Step)

    How to Start Your Own Podcast (Step by Step)

  • Checklist

    Checklist: 15 Things You MUST DO Before Changing WordPress Themes

  • Revealed: Why Building an Email List is so Important Today (6 Reasons)

    Revealed: Why Building an Email List is so Important Today (6 Reasons)

  • Google Analytics in WordPress

    How to Install Google Analytics in WordPress for Beginners

About the Editorial Staff

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi. Trusted by over 1.3 million readers worldwide.

The Ultimate WordPress Toolkit

22 Comments

Leave a Reply
  1. khatamband says:
    Sep 7, 2018 at 8:31 am

    I used today WP Mail SMTP
    I used google apps for smtp authentication and testing it with test
    but if I fill website fom, no mail is received
    I also tried hosting email address for smtp authentaction. This was also successful in sending test mail, but for form mail — no mail received, although giving success output.
    I also checked spam folder for both, nothing there too.

    So where can be the issue

    Reply
  2. Sean says:
    May 7, 2018 at 5:12 pm

    Hi when i passed the code into the wp-config file my site stopped working, then i removed it and it still not going up.
    Please help!!

    Reply
    • WPBeginner Support says:
      May 7, 2018 at 7:30 pm

      Hi Sean,

      Are you seeing an error or just white screen? Here is how you can replace your existing wp-config.php file with a fresh copy.

      First, you need to connect to your website using an FTP client and download a copy of your wp-config.php file to your computer as a backup.

      Next, you need to visit download a copy of WordPress from WordPress.org. You will need to unzip it, and inside you will find a file called wp-config-sample.php. Rename this file to wp-config.php.

      Now open the wp-config.php file you saved earlier as the backup. It contains your WordPress database information. Like database name, password, host, table prefix, etc.

      Copy the information from your backup to the new wp-config.php file and then upload the new file back to your server using the FTP client.

      Reply
      • Sean says:
        May 7, 2018 at 7:42 pm

        Hi I just found the problem. There was missing space in the first line.
        It’s strange cause I never edited it.. but everything is fine now. Thanks for quick response.

        Reply
  3. Abby says:
    Feb 15, 2018 at 8:24 am

    Hi:

    we are setting up a WordPress multi-site server. Our concern is if we use WordPress SMTP email how do we lock it down to ensure that it is not turned into an email spam bot? We occasionally experience DDOS attacks that are obviously looking for and scanning our existing business network for vulnerabilities and we do not want to give them a point of entry through the new WordPress multi site server. At present we use a self hosted exchange server for email and we have port 25, 465 and 587 locked down.

    Thanks
    Abby

    Reply
  4. Luke Cavanagh says:
    Dec 20, 2017 at 11:36 am

    Transactional email providers like SendGrid or SparkPost are very reliable for site email.

    Reply
  5. Beata Raju says:
    Nov 4, 2017 at 11:43 pm

    Hi,
    Thank you for the article, it’s really helpful. I’ve have a WordPress site hosted by HostGator with a shared server subscription. Do you know whether their email service is reliable or not? I’ve somehow managed to hook up my @mysite email address to outlook.com webmail but it does take forever for emails to come through. Do you think I should try another solution?
    Many thanks in advance,
    Beata

    Reply
    • WPBeginner Support says:
      Nov 5, 2017 at 10:41 pm

      Hi Beata Raju,

      Your hosting provider’s email service is not a reliable solution. You can look into email service provides like G Suite by Google.

      Reply
  6. Michael says:
    Oct 28, 2017 at 1:59 pm

    Sadly this option is not available in cases where GoDaddy is the host, as the blocks all outbound SMTP to ports 25, 465 and 587 to all servers except their own. :(

    Trying Amazon SES per helpful comments above.

    Reply
  7. Anssi says:
    Mar 10, 2017 at 5:40 am

    Hi!
    Any tips how to speed up the sending process when using SMTP? CF7 form takes up to 10 seconds when using SMTP and 1-4 senconds while using PHP Mailer.

    Reply
  8. Wendy says:
    Feb 26, 2017 at 11:52 pm

    Hi, i am new to wordpress.
    I am trying to configure email address using own company email.
    It was tested successfully while setup.
    But it prompt error when trying to submit request during the website.

    Reply
  9. FATOYINBO says:
    Feb 19, 2017 at 2:12 am

    God bless you, it works like magic

    Reply
  10. Marcelo Luz says:
    Jul 22, 2016 at 6:39 pm

    Works fine with WP 4.9.3.1 Thank you for the tip! ;)

    Reply
  11. Will says:
    Dec 4, 2015 at 2:44 pm

    Yes! This is the way to do it. In my case I use hostgator so it’s mail.mydomain.com and port 25 (standard email port). I was trying to use gmail and it didn’t work. I’m not sure why my site stopped working for the built in php mail even though it works on other domains on the same account.

    Reply
  12. Lynn Dye says:
    Nov 16, 2015 at 9:25 am

    This is very timely. I’ve been struggling with this on behalf of a client. When I talked them into using the built-in email of their host along with setting up domain-branded email, it took care of most problems.

    The other problem we’ve been having is getting notification emails to go to a yahoo email address. These have failed with an error message ‘not able to reach the server’, or perhaps a time-out of the server. I had that recipient get a gmail address for notifications to go to, but we’ve not seen the results yet.

    Just an PSA to folks – when I was digging into why folks with the yahoo and aol emails were not getting their notifications, the Gravity Forms folks had in their forum an article on why notifications may not be going out. Seems AOL & Yahoo have very stringent rules on accepting emails from something that looks spammy (the acronym was DMARC), I believe. So when I got one business to get rid of AOL, their problems cleared up. The other business uses Yahoo for their business email (yes, people still do it). They were not getting notified regularly and that’s why I asked them to set up a gmail.

    I will also be using some of the suggestions in this article to hopefully permanently fix this problem.

    Reply
  13. Alain Aubry says:
    Nov 15, 2015 at 4:14 pm

    If you use Mandrill you may use wpmandrill

    Reply
  14. Firdaus Azizi says:
    Nov 15, 2015 at 2:08 pm

    Used to be using WP Mail SMTP with Gmail. But since it’s not supporting oAuth, I’m now using Postman SMTP.

    I find Postman SMTP is more user friendly + it has a log file for us to check all the emails that are being sent.

    Reply
  15. sazia kazia says:
    Nov 14, 2015 at 7:41 am

    Excellent article we really need this to set up email for wordpress. I will definitely try this thanks for sharing. :)

    Reply
  16. Maggew says:
    Nov 11, 2015 at 4:47 pm

    Decent article yo. SMTP is great if you don’t send out more than 500 emails a month.

    On my site, I use Amazon SES to deliver all mail. It’s affordable at like 10,000 emails for $1 and it’s 100% guaranteed to deliver into the inbox (assuming you setup / configured properly).

    Reply
    • Abel says:
      Nov 12, 2015 at 11:56 am

      I also vouch for Amazon SES. Have also successfully used MailGun for free.

      Reply
  17. Jeff Cohan says:
    Nov 11, 2015 at 2:42 pm

    I appreciate the tutorial. However, at this writing, the WordPress dot org plugin page for WP Mail SMTP shows that the newest version of the plugin (a) hasn’t been updated in 12 months; (b) is compatible only up to WP 4.0.8, and (c) is broken (6 of 8 votes) for WP 4.3.1. What do you advise?

    Reply
    • WPBeginner Support says:
      Nov 11, 2015 at 5:36 pm

      We tested it and it works fine. If you enter the correct information in plugin settings, it would work.

      Reply

Leave a Reply Cancel reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

Over 1,320,000+ Readers

Get fresh content from WPBeginner

Featured WordPress Plugin
SeedProd WordPress Coming Soon Page Plugin
SeedProd
Jump start your website with viral coming soon pages. Learn More »
How to Start a Blog How to Start a Blog
I need help with ...
Starting a
Blog
WordPress
Performance
WordPress
Security
WordPress
SEO
WordPress
Errors
Building an
Online Store
Useful WordPress Guides
    • 7 Best WordPress Backup Plugins Compared (Pros and Cons)
    • How to Fix the Error Establishing a Database Connection in WordPress
    • Why You Need a CDN for your WordPress Blog? [Infographic]
    • 25 Legit Ways to Make Money Online Blogging with WordPress
    • Self Hosted WordPress.org vs. Free WordPress.com [Infograph]
    • Free Recording: WordPress Workshop for Beginners
    • 24 Must Have WordPress Plugins for Business Websites
    • How to Properly Move Your Blog from WordPress.com to WordPress.org
    • 5 Best Contact Form Plugins for WordPress Compared
    • Which is the Best WordPress Popup Plugin? (Comparison)
    • Best WooCommerce Hosting in 2019 (Comparison)
    • How to Fix the Internal Server Error in WordPress
    • How to Install WordPress - Complete WordPress Installation Tutorial
    • Why You Should Start Building an Email List Right Away
    • How to Properly Move WordPress to a New Domain Without Losing SEO
    • How to Choose the Best WordPress Hosting for Your Website
    • How to Choose the Best Blogging Platform (Comparison)
    • WordPress Tutorials - 200+ Step by Step WordPress Tutorials
    • 5 Best WordPress Ecommerce Plugins Compared
    • 5 Best WordPress Membership Plugins (Compared)
    • 7 Best Email Marketing Services for Small Business (2019)
    • How to Choose the Best Domain Registrar (Compared)
    • The Truth About Shared WordPress Web Hosting
    • When Do You Really Need Managed WordPress Hosting?
    • 5 Best Drag and Drop WordPress Page Builders Compared
    • How to Switch from Blogger to WordPress without Losing Google Rankings
    • How to Properly Switch From Wix to WordPress (Step by Step)
    • How to Properly Move from Weebly to WordPress (Step by Step)
    • Do You Really Need a VPS? Best WordPress VPS Hosting Compared
    • How to Properly Move from Squarespace to WordPress
    • How to Register a Domain Name (+ tip to get it for FREE)
    • HostGator Review - An Honest Look at Speed & Uptime (2019)
    • SiteGround Reviews from 1032 Users & Our Experts (2019)
    • Bluehost Review from Real Users + Performance Stats (2019)
    • How Much Does It Really Cost to Build a WordPress Website?
    • How to Start a Podcast with WordPress (Step by Step)
    • How to Choose the Best Domain Name (8 Tips and Tools)
    • How to Setup a Professional Email Address with Google Apps and Gmail
    • How to Install Google Analytics in WordPress for Beginners
    • How to Move WordPress to a New Host or Server With No Downtime
    • Why is WordPress Free? What are the Costs? What is the Catch?
    • How to Make a Website in 2019 – Step by Step Guide
Deals & Coupons (view all)
Dreamhost
DreamHost Coupon
Get 40% OFF on DreamHost and get a Free Domain.
Elegant Themes
Elegant Themes Deal
Get all 87 amazingly beautiful WordPress themes by Elegant Themes for only $69. That is like $0.79 per theme!
Featured In
About WPBeginner®

WPBeginner is a free WordPress resource site for Beginners. WPBeginner was founded in July 2009 by Syed Balkhi. The main goal of this site is to provide quality tips, tricks, hacks, and other WordPress resources that allows WordPress beginners to improve their site(s).

Site Links
  • About Us
  • Contact Us
  • FTC Disclosure
  • Privacy Policy
  • Terms of Service
  • Free Blog Setup
Our Sites
  • OptinMonster
  • MonsterInsights
  • WPForms
  • SeedProd
  • Nameboy
  • Awesome Motive

Copyright © 2009 - 2019 WPBeginner LLC. All Rights Reserved. WPBeginner® is a registered trademark.

WordPress hosting by HostGator | WordPress CDN by MaxCDN | WordPress Security by Sucuri.