Skip to content

Platform

Send: campaigns Send: SMTP relay & Email API Verify Deliver AI Automation All features

Developers

API documentation Email API overview Integrations Custom domains

Solutions

Small businesses E-commerce Agencies Startups & SaaS Creators & individuals

Resources

Blog Help center Free tools Free email verifier Blacklist checker Compare platforms Pricing

How to set up an SMTP relay in WordPress (and stop emails going missing)

WordPress sends email through PHP mail() by default, which often lands in spam or never arrives. Here is how to send WordPress and WooCommerce email through an authenticated SMTP relay in about 10 minutes.

InboxRoads Team· ·5 min read

If your WordPress contact form, WooCommerce order emails or password resets are not arriving, or land in spam, the cause is usually the same: WordPress sends email through the server's PHP mail() function by default. Those messages are not authenticated for your domain, often come from a shared hosting IP, and are easy for Gmail and Outlook to distrust.

The fix is to send WordPress email through an SMTP relay: an authenticated mail service that delivers on your behalf from your own domain. Setup takes about 10 minutes.

What you need

  • A WordPress admin login.
  • An SMTP plugin. The two most popular free ones are WP Mail SMTP and FluentSMTP.
  • SMTP relay credentials: a host, a port, a username and a password. With InboxRoads you create these under Send → SMTP relay after adding your domain.
  • Access to your domain's DNS, to add SPF, DKIM and DMARC records.

Step 1: Authenticate your sending domain

Before changing WordPress, make sure the domain in your "From" address is authenticated. Your SMTP provider gives you DNS records to add:

  1. SPF (TXT record) that authorises the relay's servers to send for your domain.
  2. DKIM (TXT or CNAME record) that lets the relay sign your messages.
  3. DMARC (TXT record at _dmarc.yourdomain.com), starting with v=DMARC1; p=none; rua=mailto:you@yourdomain.com.

Check them afterwards with a free SPF check, DKIM checker and DMARC checker. Remember that a domain may only have one SPF record: if you already have one, add the relay's include to it instead of creating a second record.

Step 2a: Set up WP Mail SMTP

  1. In WordPress go to Plugins → Add New, search for WP Mail SMTP, install and activate it.
  2. Open WP Mail SMTP → Settings.
  3. From Email: an address on your authenticated domain, for example hello@yourdomain.com. Tick Force From Email so every plugin uses it.
  4. From Name: your site or brand name. Tick Force From Name if you want it everywhere.
  5. Mailer: choose Other SMTP.
  6. SMTP Host: your relay host, for example smtp.inboxroads.com.
  7. Encryption: TLS, with SMTP Port 587. (Use SSL with port 465 only if your host blocks 587; port 2525 is a common alternative when 587 is blocked.)
  8. Auto TLS: on.
  9. Authentication: on. Enter the SMTP username and password.
  10. Save.

For better security, WP Mail SMTP lets you store the password in wp-config.php instead of the database, using its WPMS_SMTP_PASS constant. Their documentation shows the exact lines.

Step 2b: Or set up FluentSMTP

  1. Install and activate FluentSMTP from Plugins → Add New.
  2. Go to Settings → FluentSMTP and click Add Connection.
  3. Choose Other SMTP.
  4. Enter the From Email and From Name, and tick Force Sender Email.
  5. SMTP Host smtp.inboxroads.com, SMTP Port 587, Encryption TLS, Use Auto TLS yes, Authentication yes.
  6. Enter the username and password, then Save Connection Settings.

FluentSMTP also keeps an email log, which is handy when you need to prove whether a message was sent.

Step 3: Send a test email

Both plugins have an Email Test tab. Send a test to a Gmail address you own, then:

  1. Check it arrived in the inbox, not spam.
  2. Open the message, choose Show original and confirm SPF: PASS, DKIM: PASS and DMARC: PASS.
  3. Submit your contact form and place a WooCommerce test order to check those emails too.

WooCommerce emails

WooCommerce uses WordPress's mail function, so once the SMTP plugin is set up, order confirmations, invoices and account emails go through the relay automatically. Keep Force From Email on so every WooCommerce email uses your authenticated address, and check WooCommerce → Settings → Emails for the "From" name and address.

Troubleshooting

Problem Likely cause Fix
"Could not connect to SMTP host" Your web host blocks outgoing port 587 Try port 2525 or 465 (SSL), or ask the host to open the port
"Authentication failed" Wrong username or password, or a copied space Re-create the credential and paste it again
Test arrives but in spam Domain not authenticated, or a new domain Add SPF, DKIM and DMARC; send a steady volume while reputation builds
"From address not allowed" The From address is not on your verified domain Use an address on the domain you authenticated
Some emails still use the old sender A plugin sets its own From address Turn on Force From Email and Force From Name
Nothing is logged at all A caching or security plugin blocks outgoing mail Check the plugin's email log and your security plugin's settings

Frequently asked questions

Do I need an SMTP plugin if my host provides email? Your host's mail server is usually built for mailboxes, not for application email, and is often the same shared server many sites use. A dedicated SMTP relay with your own authenticated domain is more reliable for contact forms, orders and password resets.

Which port should I use for WordPress SMTP? Port 587 with TLS is the standard choice. Use 465 with SSL if 587 does not work, and 2525 if your host blocks both.

Can I send newsletters through the WordPress SMTP relay? You can send email that people asked for. For newsletters to a large list, an email marketing tool gives you unsubscribe handling, bounce suppression and reports that a WordPress plugin alone does not.

Is SMTP relay free? Providers charge per email or by monthly plan. InboxRoads charges 1 credit per recipient from the same pay-as-you-go balance used for campaigns and verification, with no monthly plan.

Next step

Create a free InboxRoads account, add your domain, and request SMTP relay access. See the SMTP relay page for ports and limits, or the setup guide for Laravel, Node.js and other apps.

Put this into practice with InboxRoads

Verify your list, authenticate your domain and send campaigns from one place. Pay only for the credits you use.

Keep reading