Intermediate Standard

How to send WordPress emails via SMTP

By Angus Published 14 May 2026 6 min read

By default, WordPress sends emails using PHP’s built-in mail function. Emails sent this way carry no authentication, which means spam filters on the receiving end often block or discard them before they reach the inbox. Switching to SMTP lets your emails leave through an authenticated mailbox, which significantly improves deliverability.

This guide walks you through installing the WP Mail SMTP plugin, connecting it to a cPanel email account and confirming that outgoing mail works correctly.

Before you begin

  • You need Administrator access to your WordPress site.
  • You need a working cPanel email account with its SMTP hostname, username and password to hand. See our guide on creating an email account if you do not have one yet.
  • We recommend noting your SMTP credentials before starting – you will need them during plugin setup.
  • Your domain should have SPF and DKIM records configured. See our guide on adding SPF records for details.

Install and activate WP Mail SMTP

WP Mail SMTP replaces WordPress’s default PHP mail function with a proper SMTP connection. Installing it from the plugin directory takes only a few clicks and requires no manual file uploads.

  1. Open the plugin installer.
    In your WordPress dashboard, go to Plugins and click Add New Plugin.
  2. Search for the plugin.
    Type WP Mail SMTP into the search box. The plugin by WPForms should appear at or near the top of the results.
  3. Install the plugin.
    Click Install Now next to WP Mail SMTP and wait for the installation to complete.
  4. Activate the plugin.
    Click Activate. WordPress will return you to the Plugins screen, where WP Mail SMTP now appears in your active plugins list.
WordPress plugin search results showing WP Mail SMTP plugin with Install Now button
WP Mail SMTP in the WordPress plugin directory.

With the plugin active, you can now configure it to send mail through your cPanel SMTP account.

Configure SMTP settings in WP Mail SMTP

The plugin needs your SMTP server details so it knows where to route outgoing mail. These settings tell WordPress which server to connect to, which port to use and how to authenticate.

  1. Open the plugin settings.
    In the WordPress dashboard, go to WP Mail SMTP and click Settings.
  2. Set the From Email and From Name.
    Enter the email address your messages will appear to come from in the From Email field. This should match the cPanel mailbox you are using. Enter a display name in the From Name field.
  3. Select the mailer.
    Scroll down to the Mailer section and select Other SMTP. A configuration panel will appear below.
  4. Enter your SMTP server details.
    Fill in the fields using the values below, replacing the placeholders with your own details:

    SMTP Host: mail.yourdomain.co.uk (replace with your actual domain or your server hostname)
    Encryption: TLS
    SMTP Port: 587
    Authentication: On
    SMTP Username: your full email address, for example hello@yourdomain.co.uk
    SMTP Password: the password for that mailbox
  5. Save the settings.
    Click Save Settings at the bottom of the page.
WP Mail SMTP settings page with Other SMTP selected and SMTP connection fields completed
The SMTP configuration panel in WP Mail SMTP.

Your SMTP credentials are now saved. The next step is to confirm the connection is working before your site starts sending real emails through it.

Send a test email

Sending a test email confirms that WordPress can connect to your SMTP server and authenticate successfully. Do this before relying on the configuration for contact forms or transactional emails.

  1. Open the Email Test tab.
    In WP Mail SMTP settings, click the Email Test tab at the top of the page.
  2. Enter a recipient address.
    Type an email address you can access in the Send To field. This is where the test message will be delivered.
  3. Send the test.
    Click Send Email. A green success banner confirms the message was sent. Check your inbox to confirm it arrived. If you see a red error banner instead, review your SMTP host, port and credentials in the settings tab and try again.
WP Mail SMTP Email Test tab with a green success banner confirming the test email was sent
A successful test email confirmation in WP Mail SMTP.

A successful test means your WordPress site is now routing all outgoing mail through authenticated SMTP.

Troubleshooting

Test email returns a connection error

A connection error usually means the plugin cannot reach your SMTP server. This is most often caused by an incorrect hostname, the wrong port number or a firewall blocking outbound connections on port 587.

  • Double-check the SMTP host matches your cPanel server hostname or mail.yourdomain.co.uk.
  • Confirm you are using port 587 with TLS encryption, or port 465 with SSL encryption.
  • Check that the email account exists and the password is correct by logging into webmail with the same credentials.

Test email sends but arrives in the spam folder

If the test email is delivered but lands in spam, the issue is likely missing or misconfigured DNS authentication records rather than the SMTP connection itself.

The From Email address does not match the SMTP account

Some mail servers reject messages where the From address differs from the authenticated sending account. This prevents spoofing but can catch misconfigured plugins.

  • Set the From Email field in WP Mail SMTP to exactly match the cPanel mailbox you entered as the SMTP username.
  • If your contact form plugin overrides the From address, check its settings for a dedicated reply-to or sender address option.

Wrapping up

Your WordPress site now sends all outgoing mail through an authenticated SMTP connection using your cPanel mailbox. This applies to contact form submissions, password reset emails and any other notifications your site generates.

If you are still seeing delivery issues, review your DNS authentication records and check the email blocked for spam guide. For contact form-specific problems, see our guide on fixing WordPress contact form issues. Bear in mind that cPanel mailboxes are not intended for bulk or mass mailing – for mailing list campaigns, use a dedicated email marketing platform instead.

Our WordPress hosting plans include cPanel email accounts ready to use as your SMTP sending address.

Running a WordPress site?

Get fast, secure and reliable WordPress Hosting with optimised for performance with AccelerateWP.

Get WordPress Hosting

Need multiple accounts?

Create fully isolated individual accounts for your clients and manage them all from one dashboard.

Get Reseller Hosting