Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
25 Million+
Websites using our plugins
Years of WordPress experience
WordPress tutorials
by experts

How to Use SMTP Server to Send WordPress Emails

Editorial Note: We earn a commission from partner links on WPBeginner. Commissions do not affect our editors' opinions or evaluations. Learn more about Editorial Process.

Are you having trouble receiving or sending emails from your WordPress site?

Email deliverability is one of the most important parts of running a website. From password reset emails to order confirmations, having a reliable email service is a must.

In this article, we will show you how to use an SMTP server to send WordPress emails.


The Problem With WordPress Emails

WordPress uses PHP for most of its functions, including sending emails.

Many shared hosting providers do not have the email 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 Workspace, 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 the WordPress not sending email issue.

Additionally, some web hosts limit the number of emails users can send from their servers. For more information about why WordPress emails won’t send, check out our blog post on why you should never use WordPress to send newsletter emails.

There is another option, however. You can use SMTP to send emails using the WordPress hosting that you already have.

SMTP, which stands for Simple Mail Transfer Protocol, allows you to use an external mail server to handle email delivery. This ensures higher email deliverability rates and can prevent your emails from landing in the spam folder.

Video Tutorial

Subscribe to WPBeginner

For written instructions, just continue reading.

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

Using your website’s domain will help you engage your subscribers from your email list and help you stay on-brand by sending messages with your domain name rather than a personal inbox.

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 using Hostinger. 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 ‘Emails’ so that you can create a new email under your domain. Then go ahead and click ‘Manage’ next to your domain.

email account hostinger

Then, you’ll need to click on ‘Create email account.’

That way, you can set up a business email under your domain name rather than the default version that WordPress gives you.

create email account

This will show you a simple form, where you need to fill out the 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 Make sure to replace with your own domain name.

Go ahead and enter your email name and password. Then click ‘Create.’

create email name and password

From here, you’ll be asked to configure third-party email services to connect to.

That said, you can choose ‘Other’ if you don’t want to use any of the given services.

configure apps and devices

Make sure to copy the SMTP Host and Port since you’ll need to add that information to the settings of your WordPress SMTP plugin to start sending emails reliably.

The SMTP Host will allow you to send emails from the email address you’ve just created, and the SMTP Port is for secure login.

Finally, go ahead and click on ‘Complete, I’ve set up my client.’

SMTP host and port

If you’re using another hosting provider, like Bluehost or SiteGround, 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.

Unfortunately, WordPress doesn’t offer built-in native SMTP settings by default. If you want to configure SMTP in WordPress for emails, you must install a SMTP plugin.

Using a WordPress SMTP plugin allows all of your emails to reach the desired destination by connecting to a server made to handle all types of emails. It will replace the default method of sending emails through WordPress, which uses the unreliable PHP mail system.

Using Your Branded Email Address in WordPress

You will now need to install and activate the WP Mail SMTP plugin.

WP Mail SMTP website

Used by over 3 million websites, the WP Mail SMTP plugin is the best SMTP plugin for WordPress. It allows you to fix your emails easily by sending them through an email provider, which is a much more reliable way of sending emails than from your web server. 

For more details, see our step-by-step guide on how to install a WordPress plugin.

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

First, you need to enter the email address you just created in the From Email field. After that, you can add a From Name that will be used as the sender name.

WP Mail SMTP Settings

Next, you need to choose the mailer. Go ahead and check the box next to Return Path that says, ‘Set the return-path to match the From Email’. After that, you need to check the box next to ‘Return Path’ option.

This option sets the return path to match the sender’s email address. If you leave it unchecked, bounced messages and non-delivery receipts will be lost.

Then, click on the ‘Other SMTP’ option to select it. If you have another mailer service, you can select that instead.

Other SMTP

Note: The free version of WP Mail SMTP supports SendLayer,, Brevo, Google Workspace, Mailgun, Postmark, SendGrid, SparkPost, and Other SMTP.

However, the Pro version also supports Amazon SES, Microsoft 365/Outlook, and Zoho Mail in addition to all the free options. Also, with the Pro version, you can turn on Detailed Email Logs and Instant Email Alerts. The email logs allow you to keep records of every email sent out, and the email alerts inform you whenever your site fails to send an email.

Next, you need to set up SMTP options.

First, you need to enter your SMTP host and port that you copied earlier.

You can obtain this information from your hosting provider. Typically, the SMTP host is (replace with your own domain name). For SMTP, Port 465 is commonly used.

Depending on your hosting provider, they’ll provide an encryption method when signing up for an email account.

In this case, we are given an SSL encryption method in Hostinger, so we will select that option. However, some hosting services may provide TLS options as well.

Choosing the encryption method is important because it ensures your emails are secure and private. Without it, the content inside the emails could be intercepted and read by unauthorized parties.

smtp host and smtp port

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

Then go ahead and give your SMTP account a password.

SMTP username and password

You can always use a password manager, like 1Password, to securely manage your passwords.

Don’t forget to click on the ‘Save Settings’ button to store your changes.

save settings

Keep in mind that if you do have another mailer service, you can add that service as a backup connection. That means if an email fails to send using your primary connection, then WP Mail SMTP will automatically try to send the email again using your backup connection.

If you’d like to add another mailer service, just hit the ‘additional connection’ link shown in the screenshot above, and WP Mail SMTP will guide you on how to do it.

If you don’t have Hostinger, these steps will look a little different. In that case, you may want to check out our ultimate guide on how to set up WP Mail SMTP with any host.

Testing Your SMTP Settings

Now that you have set up WP Mail SMTP to send emails, let’s test if everything is working fine. Head over to WP Mail SMTP » Tools in the WordPress admin panel.

Under the ‘Email Test’ tab, you need to provide an email address where you would like to receive a test email. This could be any valid email address that you can access.

Go ahead and toggle the HTML button to ‘ON.’ After that, click on the Send Email button to continue.

send a test email

WP Mail SMTP will now send an email message using the SMTP settings you entered earlier.

Check your inbox, and you should see a success message appear informing you that the email was sent successfully.

WP SMTP success message

Troubleshooting WordPress Email Issues

The most common reason for errors in sending emails using SMTP is an incorrect SMTP host or port.

Make sure that you are entering the correct host and port settings provided by your hosting provider.

smtp host and smtp port

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.

Resending Emails Manually

Even if there aren’t any SMTP configuration errors, you may still experience temporary issues.

For example, the recipient’s email server might be causing emails to bounce or the mailer service may place a cap on how many emails you can send per day. If you exceed the allowed number of sent emails in a given time frame, the emails may be rejected.

In that case, you can simply resend it to those specific recipients. All you have to do is head over to WP Mail SMTP » Email Log.

Simply check all of the boxes next to the emails that failed to resend, and under the Bulk Actions dropdown menu, select the ‘Resend’ option and click ‘Apply.’

resend emails

Then, a pop-up message will appear, asking you to confirm if you want to resend the selected emails.

Go ahead and hit the ‘Yes’ button.

heads up message

Finally, you’ll receive a confirmation message on the screen that the emails are in the queue and will be resent shortly. Then, click ‘OK.’

There you have it! Now you know how to successfully use an SMTP server to send WordPress emails.

ok button

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

First and foremost, the most obvious advantage of using your web host’s servers for sending emails in WordPress is that you can use your own branded email address.

Another pro 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 to send and receive emails.

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

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 Workspace, Mailgun, or SendGrid.

We hope this article helped you learn how to use an SMTP server to send WordPress emails. You may also want to see our list of the must have WordPress plugins for businesses or our guide on how to create a free business email address.

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.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us. Here's our editorial process.

Editorial Staff

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit - a collection of WordPress related products and resources that every professional should have!

Reader Interactions

28 CommentsLeave a Reply

  1. Syed Balkhi says

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

  2. Moinuddin Waheed says

    This plugin is one of the few plugins that must be there in every wordpress installation.
    The uncertainty of emails not getting delivered is very problematic.
    I have installed this plugin on my website and now I am free of any such email deliverability concern.
    Thanks for the detailed guide.

  3. MH says

    If there have any option to configure multiple email as SMTP ?
    I have two contact form and need to email sent from different email address.

    • WPBeginner Support says

      You would want to check with the support for your contact form to see what is available.


  4. khatamband says

    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

  5. Sean says

    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!!

    • WPBeginner Support says

      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 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.


      • Sean says

        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.

  6. Abby says


    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.


  7. Beata Raju says

    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 webmail but it does take forever for emails to come through. Do you think I should try another solution?
    Many thanks in advance,

  8. Michael says

    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.

  9. Anssi says

    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.

  10. Wendy says

    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.

  11. Will says

    Yes! This is the way to do it. In my case I use hostgator so it’s 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.

  12. Lynn Dye says

    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.

  13. Firdaus Azizi says

    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.

  14. sazia kazia says

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

  15. Maggew says

    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).

  16. Jeff Cohan says

    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?

Leave A 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.