DixonSMTP for Outlook & Microsoft 365

Description

WordPress’ default PHP mail() delivery is frequently blocked or spam-foldered. DixonSMTP for Outlook & Microsoft 365 routes every email your site sends (core, WooCommerce, WPForms, Contact Form 7, Gravity Forms, and anything else using wp_mail()) through Microsoft’s SMTP servers — authenticated, encrypted, and deliverable.

100% free. No premium upsell, no paid tiers, no feature gating.

Why OAuth 2.0?

Microsoft has deprecated Basic Authentication for Exchange Online and is progressively disabling password-based SMTP AUTH (new Microsoft 365 tenants have it off by default). OAuth 2.0 (“Modern Authentication”) is the supported, secure path forward — which is why this plugin is OAuth-only by design. It implements the full Microsoft identity platform authorization code flow with automatic token refresh, so you sign in once and it keeps working.

Features

  • OAuth 2.0 (Modern Auth) for Microsoft 365 / Entra ID — authorization code flow, automatic access-token refresh, encrypted token storage
  • From Email / From Name with optional force-override (recommended — Microsoft rejects mismatched senders)
  • Test email tool with a full SMTP debug transcript
  • Email log (last 10–500 emails, configurable) with status and error details in a custom table
  • Optional fallback to the default PHP mailer when SMTP fails
  • Failure notifications to the site admin after repeated errors (rate-limited)
  • Debug mode compatible with WP_DEBUG_LOG
  • Multisite compatible (network activation supported; settings are per-site)
  • Secrets (client secret, OAuth tokens) stored encrypted (AES-256 keyed from your WordPress salts)
  • Translation-ready, fully sanitized/escaped, capability + nonce protected

Compatibility

Works with any plugin that sends mail through wp_mail(): WPForms, Contact Form 7, Gravity Forms, Ninja Forms, WooCommerce, Easy Digital Downloads, membership and newsletter plugins, etc.

Microsoft 365 / Azure OAuth Setup

You need a (free) app registration in Microsoft Entra ID. One-time setup, about 5 minutes:

1. Register the application

  1. Sign in to https://entra.microsoft.com (or the Azure Portal Microsoft Entra ID).
  2. Go to Identity Applications App registrations New registration.
  3. Name: e.g. WordPress SMTP.
  4. Supported account types:
    • Accounts in this organizational directory only — single company tenant (most common; use your Tenant ID in the plugin).
    • Accounts in any organizational directory and personal Microsoft accounts — needed for personal Outlook.com mailboxes (use common in the plugin).
  5. Redirect URI: choose platform Web and paste the exact Redirect URI shown on the plugin’s OAuth 2.0 tab
    (it looks like https://your-site.com/wp-json/dxn-outlook/v1/callback).
  6. Click Register.

2. Collect the IDs

  • On the app’s Overview page copy the Application (client) ID and Directory (tenant) ID into the plugin’s OAuth tab.

3. Create a client secret

  1. Go to Certificates & secrets New client secret.
  2. Choose an expiry (set a calendar reminder — you must rotate it before expiry!).
  3. Copy the secret Value (not the Secret ID) immediately — it is shown only once — and paste it into the plugin.

4. Add API permissions

  1. Go to API permissions Add a permission.
  2. Choose APIs my organization uses and search for Office 365 Exchange Online
    (or use Microsoft Graph Delegated if SMTP.Send appears there in your tenant).
  3. Select Delegated permissions SMTP.Send, then Add.
  4. offline_access, openid, profile, email are requested automatically at sign-in; no admin action usually needed. If your tenant requires it, click Grant admin consent.

5. Enable SMTP AUTH for the mailbox

Even with OAuth, Exchange Online requires SMTP AUTH to be allowed for the sending mailbox:

  • Microsoft 365 admin center Users Active users select user Mail Manage email apps check Authenticated SMTP, or
  • PowerShell: Set-CASMailbox -Identity user@domain.com -SmtpClientAuthenticationDisabled $false

6. Authorize the plugin

  1. Save the Client ID, Client Secret and Tenant ID on the plugin’s OAuth 2.0 tab.
  2. Click Sign in with Microsoft & Authorize and sign in with the mailbox that should send email.
  3. When you return, the status shows Connected. Send a test email.

External Services

This plugin connects to Microsoft services in order to authenticate and deliver email. No data is sent to the plugin author or any other third party.

  • Microsoft identity platform (login.microsoftonline.com) — used for OAuth 2.0 sign-in and token refresh. Sends your Azure app Client ID, Client Secret, authorization codes and refresh tokens. Contacted when you click “Sign in with Microsoft” and automatically before sending when the access token needs refreshing.
  • Microsoft SMTP servers (smtp.office365.com or the host you configure) — used to deliver email. Sends the email content, sender and recipient addresses, and an OAuth access token for authentication. Contacted on every outgoing email.

These services are provided by Microsoft: Terms of Use, Privacy Statement.

Screenshots

Installation

  1. Upload the dixonsmtp-for-outlook-microsoft-365 folder to /wp-content/plugins/, or install the ZIP via Plugins Add New Upload Plugin.
  2. Activate the plugin through the Plugins screen.
  3. Go to Settings Outlook SMTP.
  4. On the General tab: set your From Email (the Microsoft mailbox you will authenticate) and From Name, and enable the mailer.
  5. Follow the OAuth setup below.
  6. Use the Test Email tab to confirm delivery.

FAQ

Which SMTP settings do I use for Microsoft 365?

Host smtp.office365.com, port 587, encryption TLS. These are the plugin defaults.

I get “5.7.139 Authentication unsuccessful, SmtpClientAuthentication is disabled”

SMTP AUTH is disabled for the tenant or mailbox. Follow step 5 of the OAuth setup above.

I get “5.7.60 Client does not have permissions to send as this sender”

Your From Email must be the authenticated mailbox itself, or an address that mailbox has Send As rights for. Enable “Force From Address” and set the From Email to the connected mailbox.

Does this work with personal Outlook.com accounts?

Yes — register the Azure app with support for personal Microsoft accounts and set Tenant ID to common. Host stays smtp.office365.com (or smtp-mail.outlook.com).

Where are my credentials stored?

In your WordPress database, encrypted with AES-256 using a key derived from your site’s unique AUTH_KEY/SECURE_AUTH_KEY salts. Nothing is sent to any third party except Microsoft’s own OAuth/SMTP endpoints.

The OAuth redirect returns a 404

Your REST API permalinks are disabled or blocked. Enable pretty permalinks (Settings Permalinks) and make sure /wp-json/ is reachable, then re-copy the Redirect URI.

Is Multisite supported?

Yes. The plugin can be network-activated; each site keeps its own settings, connection and log.

Reviews

There are no reviews for this plugin.

Contributors & Developers

“DixonSMTP for Outlook & Microsoft 365” is open source software. The following people have contributed to this plugin.

Contributors

Changelog

1.0.0

  • Initial release: OAuth 2.0 SMTP for Outlook / Microsoft 365, email log, test tool, fallback mailer, failure notifications, encrypted secret storage, multisite support.