OquMail
Loading account…
Email API4 min readUpdated

WordPress Not Sending Email? Use SMTP on Your Own Domain

WordPress sends through PHP mail() and hosts junk it. Fix it with an SMTP plugin and a mailbox on your domain: exact settings, wp-config constants, forms.

Out of the box WordPress hands every email to the PHP mail() function on the web server. On shared hosting that means a message from an IP you do not control, with no DKIM signature and an SPF record that does not list the server, so password resets, order confirmations and contact-form notices either never leave or land in spam. The fix is not another plugin that promises deliverability; it is sending through a real mailbox on your own domain over SMTP. Here are the exact settings, the wp-config alternative, and the two places where forms and WooCommerce go wrong.

Quick answer

Create a mailbox such as notifications@yourdomain.com, install WP Mail SMTP (FluentSMTP and Post SMTP work the same way), choose Other SMTP, and enter host mail.oqumail.com, port 587, encryption TLS, authentication on, the full mailbox address as the username and its password. Set From Email to that mailbox and turn on Force From Email. Send the plugin's test email to yourself.

Why wp_mail fails on most hosts

  • PHP mail() sends from the web server, whose IP is shared with hundreds of other sites and is often on blocklists.
  • The message is not DKIM-signed for your domain, and your SPF record does not include the web server, so it fails authentication at Gmail and Outlook.
  • Many hosts block or rate-limit mail() outright, so WordPress reports success and nothing arrives.
  • Form plugins set From to the visitor address, which fails DMARC for the visitor domain and is rejected.

The plugin settings

In WP Mail SMTP, Settings, General. The same fields exist under different names in FluentSMTP and Post SMTP:

Mailer:            Other SMTP
SMTP Host:         mail.oqumail.com
Encryption:        TLS            (this is STARTTLS; do not pick SSL)
SMTP Port:         587
Authentication:    On
SMTP Username:     notifications@yourdomain.com
SMTP Password:     the mailbox password
From Email:        notifications@yourdomain.com   Force From Email: On
From Name:         Your Shop Name                  Force From Name: On

Or set it in wp-config.php

WP Mail SMTP reads these constants and locks the settings screen, which keeps the password out of the database and out of exports:

define( 'WPMS_ON', true );
define( 'WPMS_MAILER', 'smtp' );
define( 'WPMS_MAIL_FROM', 'notifications@yourdomain.com' );
define( 'WPMS_MAIL_FROM_FORCE', true );
define( 'WPMS_MAIL_FROM_NAME', 'Your Shop Name' );
define( 'WPMS_SMTP_HOST', 'mail.oqumail.com' );
define( 'WPMS_SMTP_PORT', 587 );
define( 'WPMS_SSL', 'tls' );
define( 'WPMS_SMTP_AUTH', true );
define( 'WPMS_SMTP_USER', 'notifications@yourdomain.com' );
define( 'WPMS_SMTP_PASS', 'the-mailbox-password' );

Step by step

  1. In OquMail create the mailbox notifications@yourdomain.com (or hello@ if you want replies to land somewhere a person reads). Note its password.
  2. In WordPress install and activate WP Mail SMTP, FluentSMTP or Post SMTP.
  3. Enter the settings above, or add the constants to wp-config.php above the "stop editing" line.
  4. Use the plugin Email Test tab to send to your own address. A green result means the relay accepted it; check the inbox, not just the result.
  5. Open your contact-form plugin and set every notification From to the same mailbox, with the visitor address as Reply-To.
  6. If you run WooCommerce, place a test order; the order emails now go out through the same mailbox.
  7. Send one real message from the mailbox in webmail to a Gmail address and confirm it arrives in the inbox with a DKIM pass under Show original.

Free business email on your own domain

OquMail gives you up to 15 mailboxes on your domain — free — with guided SPF/DKIM/DMARC, webmail, IMAP/SMTP for any mail app, and a send API. Setup is a few DNS records; changes usually take effect within minutes, occasionally up to 48 hours. Start at oqumail.com.

Get started free

Contact forms: From is you, Reply-To is them

Contact Form 7, WPForms, Gravity Forms and Fluent Forms all let you set the From and Reply-To headers per notification. From must be your mailbox, because the relay only sends as the authenticated address and because a From on the visitor's domain fails their DMARC. Reply-To is where the visitor's address goes, so clicking Reply in the team inbox answers the right person. Contact Form 7 users: in the Mail tab, From is [_site_title] <notifications@yourdomain.com> and Additional Headers gets Reply-To: [your-email].

WooCommerce and volume

Every WooCommerce email, from new-order to password reset, goes through wp_mail, so once the plugin is configured they all send from your domain. The free plan allows 250 sends a day per mailbox. A shop doing more than a hundred orders a day will approach that with customer plus admin copies; create a second mailbox for admin notifications, or talk to us about a larger allowance. Marketing emails from a newsletter plugin should not go through this path at all; they belong in a list tool with unsubscribe handling.

Pitfalls

  • Encryption set to SSL with port 587. The test fails with a TLS error. Use TLS (STARTTLS) on 587.
  • From Email left as the WordPress admin Gmail address. Turn on Force From Email so plugins cannot override it.
  • The host blocks outbound 587. Rare, but the plugin test will say "connection refused" or time out; ask the host to open it.
  • Changing the mailbox password in OquMail and forgetting the plugin. Every WordPress email then fails with an authentication error until it is updated.
  • Using a person's mailbox for the site. When they leave, the site stops sending. Use a role mailbox.
  • Leaving a Gmail address in Settings, General, Administration Email Address. Change it to a mailbox on the domain too.

Common questions

Do I need the API instead of SMTP?

No. WordPress speaks SMTP natively through these plugins and there is nothing to gain from the API for site mail. The API is for application code you write yourself.

Can I see whether an email was delivered?

Yes. The mailbox Sent folder shows every message the site sent, and the delivery log in the OquMail dashboard shows the receiving server's response for each one. The plugin's own log, if you enable it, shows what WordPress handed over.

What about WordPress.com?

Managed WordPress.com plans do not allow SMTP plugins on the lower tiers. Our WordPress.com email alternative covers the options there.

Want to see how your own domain is set up? Use the free SPF checker and DMARC checker: they run in your browser and store nothing.