Send WordPress email through SMTP

wordpress, smtp, wp mail smtp, email, woocommerce, forms · 0 found this helpful

By default, WordPress sends email through the server's PHP mail function. That mail is unauthenticated and often goes to spam. An SMTP plugin makes WordPress log in to a real mailbox and send like any mail app.

Before you start

  1. Create a mailbox for the site, such as [email protected]. See Create an email account. Use a strong password.
  2. Check authentication. Confirm SPF and DKIM are valid in Account → Hosting → your site → Email → Deliverability. See Set up SPF, DKIM, and DMARC.
  3. Pick a plugin. Any maintained SMTP plugin works. WP Mail SMTP is a common choice, and the steps below use its labels.

Settings

Setting Value
SMTP host mail.example.ca
Encryption SSL/TLS
SMTP port 465
Authentication On
Username [email protected]
Password The mailbox password
From email [email protected]
From name North Shore Bakery
Force From email On

Use port 587 with TLS (STARTTLS) if 465 is not available in your plugin. See Email server settings.

Steps

  1. In WordPress, go to Plugins → Add New Plugin.
  2. Search for WP Mail SMTP or another SMTP plugin, then select Install Now and Activate.
  3. Open the plugin's settings page.
  4. Choose Other SMTP as the mailer.
  5. Enter the values above.
  6. Save.
  7. Use the plugin's Send Test Email option to send to yourself.
  8. Send a test to a Gmail address and open Show original. Check SPF, DKIM, and DMARC all pass.

Storing the password safely

Some plugins let you define the password in wp-config.php so it is not in the database.

define( 'WPMS_ON', true );
define( 'WPMS_SMTP_PASS', 'your-mailbox-password' );

These names are for WP Mail SMTP. Other plugins use their own, so check their documentation.

Contact form plugins

Make sure each form's From uses the same address as the SMTP username, and Reply-To is the visitor's address. See Website contact forms not sending email.

Limits

Mail from the site counts against your sending limits. See Sending limits. For newsletters, use a dedicated service. See Sending newsletters.

If something goes wrong

Message Fix
"SMTP Error: Could not authenticate" Check the full address and the password
"Could not connect to SMTP host" Check host, port, and encryption. Try 587 with TLS.
"Sender address rejected" Use the SMTP mailbox's address as From
Test works, form emails fail The form plugin has its own From setting
Mail goes to spam Check SPF, DKIM, and DMARC. See Why your email lands in spam.
Password changed, mail stopped Update the password in the plugin

Check Account → Hosting → your site → Email → Track delivery if mail still seems missing. See Track a missing email.

Was this helpful?

Still stuck? Ask us and we'll walk you through it.