Skip to content
WebHostsOnline Web-Solutions
  • Home
  • Domains
    • Domains
    • Transfer Your Domain
    • Order SSL Certificates
  • Cloud Hosting
    • AWS Hosting
    • Cloud i Hosting from WebHostsOnline
    • Google Cloud Servers
    • Magento Hosting
    • WooCommerce Hosting
    • Timeline Backups
  • Hosting
    • Shared Hosting
    • Website Builder
    • Website Design & Hosting
  • Email Hosting
  • WordPress
    • Free Hosting
    • WooCommerce Hosting
    • WordPress Hosting
  • VPS Hosting
  • Tools
    • SSL Certificates
    • Timeline Backup-Pro
    • Website Turbo
  • My Account
Contact Us
alt
WebHostsOnline Web-Solutions
  • hello@webhostsonline.co.uk
back to top

WordPress: use SMTP with and without plugins

  • WebHostsOnline Web-Solutions
  • /knowledge-base
  • Email Hosting
  • WordPress: use SMTP with and without plugins

My Account

3
  • How do I register a new domain with WebHostsOnline?
  • Which nameservers should I use with WebHostsOnline hosting?
  • Where can I update my account / profile details?

Cloud Servers

10
  • How do I add another server/include to an SPF record?
  • Managed Cloud Server: Manage Your Cloud Server
  • Managed Cloud Server: Registering Domain Names
  • How can I clone a site with Timeline Backups?
  • How do I restore a site using Timeline Backups?
  • How do I set up Automatic Timeline Backups?
  • Does your hosting support Django?
  • Does your Windows hosting support .NET Core?
  • How do I activate my free SSL?

Domains

10
  • How can I create a subdomain?
  • Managed Cloud Server: Registering Domain Names
  • Domain transfer statuses explained?
  • What are WebHostsOnline nameservers?
  • How to transfer your domain from 123-reg WebHostsOnline
  • How to transfer your domain from Ionos to WebHostsOnline
  • How to transfer your domain from GoDaddy to WebHostsOnline
  • How to transfer your domain from Easyspace to WebHostsOnline
  • My domain is locked with my current provider, what can I do?
  • How do I transfer my domain to you?

Email Hosting

13
  • How to create an autoresponder?
  • How do I add Office 365 DNS records?
  • Why are the IMAP folders missing from my iPhone or iPad?
  • What are the recommended Thunderbird Mail client settings?
  • How do I add another server/include to an SPF record?
  • WordPress: use SMTP with and without plugins
  • What are the Free Tools with WordPress Hosting?
  • How do I use the free WebHostsOnline Website Malware Scanner? 
  • What are my email sending limits?
  • How do I set up email on my iPhone?
  • How do I set up my WebHostsOnline mailbox in Outlook?
  • How do I create a mailbox?
  • How to use the email migration tool

FTP

2
  • How to connect Web Hosting via FTP?
  • I can’t connect via FTP, what can I do?

Web Hosting

18
  • How can I clone a site with Timeline Backups?
  • How do I restore a site using Timeline Backups?
  • How do I set up Automatic Timeline Backups?
  • Does your hosting support Django?
  • WordPress caching: what you need to know
  • Do I need caching plugins in addition to the WebHostsOnline CDN?
  • Why am I getting a cache status ‘MISS’?
  • How do I use WebHostsOnline’s CDN?
  • How do I create a Website Acceleration Suite template?
  • Improve your WordPress website’s TTFB
  • What is the Website Acceleration Suite?
  • Why could my WordPress migration fail?
  • Do you support WordPress multisite?
  • How do I activate my free SSL?
  • How do I run a search and replace in the WordPress CLI?
  • How do I create a MySQL database in MyWebHostsOnline
  • How do I change PHP version?
  • How to modify your hosts file for Windows, macOS and Linux.

WordPress

21
  • I installed WordPress on the temporary URL, how can I change it to my domain name?
  • WordPress Multisite Setup Guide
  • How can I clone a site with Timeline Backups?
  • How do I restore a site using Timeline Backups?
  • How do I set up Automatic Timeline Backups?
  • Why do I get an Internal Server Error 500 and how to fix it?
  • WordPress: use SMTP with and without plugins
  • WordPress caching: what you need to know
  • Do I need caching plugins in addition to the WebHostsOnline CDN?
  • Why am I getting a cache status ‘MISS’?
  • How do I use WebHostsOnline’s CDN?
  • How do I create a Website Acceleration Suite template?
  • Improve your WordPress website’s TTFB
  • What is the Website Acceleration Suite?
  • Why could my WordPress migration fail?
  • Do you support WordPress multisite?
  • How do I activate my free SSL?
  • How do I run a search and replace in the WordPress CLI?
  • Is it safe to update the PHP version on my website?
  • How do I migrate a website manually?
  • WooCommerce
    • WordPress Multisite Setup Guide

Migrations

3
  • Why could my WordPress migration fail?
  • How do I migrate a website manually?
  • How to modify your hosts file for Windows, macOS and Linux.

SSL Certificates

2
  • How do I activate my free SSL?
  • Can I use the free SSL if my site doesn’t use the WebHostsOnline nameservers?

Security

3
  • What are the Free Tools with WordPress Hosting?
  • How do I use the free WebHostsOnline Website Malware Scanner? 
  • Protecting your password from brute-force attacks

DataBase

13
  • How to connect Web Hosting via FTP?
  • MS-SQL
    • How do I import a .sql file via the command-line?
    • How do I manage my Microsoft SQL database?
    • What is MS-SQL?
  • MySQL
    • How do I export a .sql file via the command-line
    • How do I download or back up my MySQL Database?
    • How do I import a .sql file via the command-line?
    • Can I view my FTP, email address, or database passwords?
    • How do I create a MySQL database?
    • What’s the maximum MySQL database size allowed?
    • Can I set my database hostname as ‘localhost’?
    • How do I import a .sql file via phpMyAdmin?
    • What is MariaDB?

VPS

14
  • How do I connect to my Windows virtual machine via Remote Desktop?
  • How set up Mastodon on a Self-Managed VPS
  • How do I connect to an Unmanaged VPS using SSH?
  • How do I install and enable Apache and PHP modules on my cPanel VPS?
  • Does your hosting support Django?
  • How do I raise an additional IP address on my CentOS virtual machine?
  • How do I add an additional IP address to my virtual machine?
  • What version of Windows do you run on the Windows servers?
  • Does your Windows hosting support .NET Core?
  • How do I connect to my Windows virtual machine via Remote Desktop?
  • Windows
    • How do I connect to my Windows virtual machine via Remote Desktop?
    • Managing the Windows Application Pool
    • What version of Windows do you run on the Windows servers?
    • Does your Windows hosting support .NET Core?

Backups

3
  • How can I clone a site with Timeline Backups?
  • How do I set up Automatic Timeline Backups?
  • How do I restore a site using Timeline Backups?

SSH

8
  • Can I use sudo on shared hosting?
  • What is the PHP memory_limit?
  • How do I connect via SSH using 2FA?
  • How do I connect via SSH?
  • How do I import a .sql file via the command-line?
  • How do I connect via SSH on an Apple Mac?
  • How do I connect via SSH on an Apple Mac?
  • How do I run Composer via SSH?
View Categories
  • Home
  • /knowledge-base
  • Email Hosting
  • WordPress: use SMTP with and without plugins

WordPress: use SMTP with and without plugins

8 min read

AI Doc Summarizer Doc Summary
AI Doc Summarizer Thinking Thinking

Sending emails directly from your WordPress site can be critical to your site’s success. It could be from a contact form to help your clients get in touch if they’re interested in your services, order emails to confirm details and provide receipts for purchases, or password reset emails to allow users access to their accounts.

WordPress itself comes with functionality out of the box that can allow for sending emails, but it’s not as secure as it could be, and can more often than not result in your business-critical emails resulting in the Spam folder.

Making use of SMTP with your WordPress site, however, can ensure that all of these important emails make it to their intended audience. Setting them up is much easier than you’d think. This guide will step you through what SMTP is, why it’s important to make use of it on your WordPress sites, and explain a couple of ways for you to get started using SMTP as soon as possible.

What is SMTP?

SMTP, also known as the Simple Mail Transfer Protocol, is the main protocol used to send and receive email. A majority of email systems make use of SMTP to send out emails between servers. These emails can then be retrieved using email client protocols such as IMAP  or POP3.

Why should I use SMTP with WordPress?

By default, WordPress makes use of PHP Mail using the wp_mail function to send emails from contact forms, product orders and other functions that send out automated emails. However, PHP Mail lacks any form of authentication – it simply sends with the from address it’s provided directly from the server itself.

As a result, PHP Mail often gets used to spoof email addresses, commonly enough that some mail hosts simply mark emails from PHP Mail as spam or may even get blocked.

SMTP, on the other hand, connects to a mailbox directly and authenticates the connection using the mailbox password before it sends. This means that only setups with the correct mailbox details can actually send out emails. This is considered much more secure and can ensure that your site’s emails are less likely to be seen as spam and make their way to your intended recipients.

How can I connect using SMTP?

Connecting your WordPress site to your mailboxes using SMTP first requires you to understand where your emails are hosted – each mail host has a different hostname for their SMTP services. Knowing what this is can save you a headache in the long run. Some services have setups available to allow you to use smtp.yourdomain.com to connect, but this requires that subdomain on your domain to be pointed to their services.

If your emails are hosted here with us at WebHostsOnline, our SMTP settings are as follows:

Hostname: smtp.stackmail.com

Port: 465 (SSL) or 587 (TLS)

Security: SSL/TLS

Username: Your email address you want to send with

Password: The password of the mailbox you want to send with

If you use Office365 to host your mailboxes instead, you’ll need to use their SMTP details:

Hostname: smtp.office365.com

Port: 587

Security: STARTTLS

Username: Your email address you want to send with

Password: The password of the mailbox you want to send with

Other mail hosts will provide guidelines or quick references online that will specify the SMTP connection details you need. If you’re unsure, check with them directly to confirm.

Once you have the details you need, it’s time to connect. Doing so can be done a couple of ways, depending on how confident you are with coding.

Connecting to SMTP using a Plugin

If you’re unsure and want an easy way to do it, there are a great number of WordPress plugins that handle the heavy workload of the connection for you, allowing you to simply pop in your SMTP details and begin sending straight away. We’ll demonstrate the setup SMTP in WordPress with a plugin using two examples of popular ones. These are:

WP Mail SMTP

WP Mail SMTP is a free plugin that comes with a wizard that runs automatically upon installation and steps you through setting up your SMTP connection. When you first install it, you’ll be prevented with the following screen:

Select Let’s Get Started and you’ll be presented with some options for what type of SMTP service you use – there’s various auto configurations for different hosts, such as Google, Office365, Mailgun and SendGrid. If you use WebHostsOnline’s mail services, you’ll want to select Other SMTP. If you’re unsure, check with your current mail host.

On the next page, you’ll be presented a form – follow the steps here to fill out your details. SMTP Host is where you’d input your hostname, and Encryption is your security – we recommend SSL or TLS, depending on what host you use.

Make sure that Authentication is enabled, then input your SMTP Username and SMTP Password â€“ these are the email and the mailbox password respectively. Lastly, set a From Name, which is the name that will appear as the sender of the email, and the From Email. You’ll want to make sure the From Email matches the SMTP username.

WP Mail SMTP will then prompt you with some additional preferences – you can choose to enable these based on what you’d like of the plugin. If you’re unsure, leave it as default.

WP Mail SMTP will then run a quick test of the settings you’ve used – if there’s any errors, you’ll then be prompted to recheck your details.

If not, you’ll see the following screen:

And you’re all set to send your emails using SMTP.

Easy WP SMTP

Easy WP SMTP aims to make setting SMTP up and testing as quick and as simple as possible. Once it’s installed, head to the Settings tab of your WP Admin area, and you should see a new option for Easy WP SMTP.

Once selected, you’ll be greeted with a form with all of your needed details. From Email Address is the email address you wish to use for sending, and your From Name is the name you want the email to appear to come from. Reply-To Address is the address used for the Reply-To field, and you can also set a BCC Email Address if you want to have a copy of the email sent to another mailbox.

Below that, you have entry fields for your SMTP Host, which is your email provider’s SMTP hostname, the Encryption, which is the security, and your SMTP Port. Set these to your mail provider’s required settings, and select Yes on SMTP Authentication.

Lastly, enter the mailbox you wish to send from into SMTP Username and the mailbox’s password in SMTP Password, and hit Save Changes.

You can then navigate to the Test Email tab at the top of the form, and send a test email to check the SMTP settings are configured correctly.

If everything is configured correctly, you’ll get a popup confirming your email went through, and you’ll be all set to begin sending emails from your WordPress site using SMTP.

Without Plugins

If you’re more confident with PHP coding and the inner workings of WordPress, you can also set up your SMTP details directly using code. To do this, you’ll need to have set up a WordPress child theme – WordPress themselves provide a guide on how to do so here [ https://developer.wordpress.org/themes/advanced-topics/child-themes/ ]

Note: Before attempting this, make a backup of your site files so that you have a restore point.

In order to do so, first head to your wp-config.php file in the core folder of your WordPress site and add the following code:

// Configure your site to use SMTP

    define( ‘SMTP_USER’,   ’email@example.com’ );    // Username to use for SMTP authentication

    define( ‘SMTP_PASS’,   ‘MAIL_PASSWORD’ );       // Password to use for SMTP authentication

    define( ‘SMTP_HOST’,   ‘smtp.stackmail.com’ );    // The hostname of the mail server

    define( ‘SMTP_FROM’,   ’email@example.com’ ); // SMTP From email address

    define( ‘SMTP_NAME’,   ‘FROM_NAME’ );    // SMTP From name

    define( ‘SMTP_PORT’,   ‘587’ );                  // SMTP port number – likely to be 25, 465 or 587

    define( ‘SMTP_SECURE’, ‘tls’ );                 // Encryption system to use – ssl or tls

    define( ‘SMTP_AUTH’,    true );                 // Use SMTP authentication (true|false)

    define( ‘SMTP_DEBUG’,   0 );                    // for debugging purposes only set to 1 or 2

This sets up the base configurations for your SMTP setup – you’ll want to modify the values above to match the recommended settings provided by your email host, and your own personal preferences.

Then, head to your child theme folder in wp-content > themes and open functions.php. In this file, add the following code:

    // Configures SMTP authentication for your site

    add_action( ‘phpmailer_init’, ‘send_smtp_email’ );

    function send_smtp_email( $phpmailer ) {

        $phpmailer->isSMTP();

        $phpmailer->Host       = SMTP_HOST;

        $phpmailer->SMTPAuth   = SMTP_AUTH;

        $phpmailer->Port       = SMTP_PORT;

        $phpmailer->Username   = SMTP_USER;

        $phpmailer->Password   = SMTP_PASS;

        $phpmailer->SMTPSecure = SMTP_SECURE;

        $phpmailer->From       = SMTP_FROM;

        $phpmailer->FromName   = SMTP_NAME;

    }

And that’s it – your site should now be able to use SMTP for sending your emails directly from your website.

Setting up SMTP with the above steps can ensure that your sent emails are safe, and better improve your chances of having them arrive with your clients without being flagged as spam and potentially missed.

Updated on October 18, 2025

What are your Feelings

  • Happy
  • Normal
  • Sad

Share This Article :

  • Facebook
  • X
  • LinkedIn
  • Pinterest
How do I add another server/include to an SPF record?What are the Free Tools with WordPress Hosting?

Powered by BetterDocs

Leave a Comment Cancel reply

WebHostsOnline Web-Solutions

Contact

  • Church Yard,
    Ashford Kent.
    TN23 1QG
  • hello@webhostsonline.co.uk

Links

  • Cloud Hosting
  • Joomla Hosting
  • Laravel Hosting
  • .Net Core Hosting
  • NodeJS Hosting
  • PHP Hosting
  • VPS Hosting
  • My WebHostsOnline Demo
  • WebMail

Support

  • Contact Us
  • Knowledge Base
  • System Status

Company

  • About
  • Blog
  • Cookie Policy
  • Disclaimer
  • Imprint
  • Privacy Statement
  • Terms and Conditions
  • Website Design Service Terms and Conditions of Service

All rights reserved © WebHostsOnline Web-Solutions. | Part of the GMCi Group
Registration No. 17215955, Registered in England and Wales.

Manage Consent
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behaviour or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
Manage options Manage services Manage {vendor_count} vendors Read more about these purposes
View preferences
{title} {title} {title}