How to send WordPress email through SMTP

Stop WordPress password resets, contact forms and order emails going missing by sending through an authenticated mailbox with an SMTP plugin.

How-to guideIntermediate2 min readUpdated

By default, WordPress sends mail through PHP’s basic mail function, often with a From address like wordpress@yourdomain.co.uk that doesn’t exist. Receiving servers treat that with suspicion. Sending through a real mailbox fixes it.

1. Create a sending mailbox

Create website@yourdomain.co.uk (or similar) in E-mail Manager then E-mail Accounts. How to create an email account in DirectAdmin

2. Install an SMTP plugin

In Plugins → Add New, search for SMTP and install a well-maintained SMTP plugin with a large number of active installations. Configure it with “Other SMTP” as the mailer.

3. Enter the settings

SettingValue
From Emailwebsite@yourdomain.co.uk
Force From EmailOn
From NameYour site name
SMTP Hostmail.yourdomain.co.uk
EncryptionSSL
SMTP Port465
AuthenticationOn
Usernamewebsite@yourdomain.co.uk
PasswordThe mailbox password

Use TLS with port 587 if SSL on 465 doesn’t connect.

4. Send a test

Use the plugin’s test email to send to an outside address, such as Gmail. In Gmail, Show original should show SPF and DKIM passing.

Contact forms

In your form plugin, set:

  • From: website@yourdomain.co.uk
  • Reply-To: the visitor’s email field

Never set From to the visitor’s address. Sending email from your website reliably

Keeping the password safer

Many SMTP plugins let you define the password in wp-config.php instead of the database. Use that option if offered.

Not hosting with Traxio yet? WordPress hosting from 99p a month is free for 30 days with no card, then £0.99 a month.

Popular

Tip: press / to search from any pageSee all results