If you followed an older tutorial to set up a WordPress SMTP plugin for Office 365 by typing a username and password into smtp.office365.com on port 587, you probably hit an immediate 535 5.7.139 Authentication unsuccessful error. Microsoft has retired Basic Authentication across Exchange Online, and modern Security Defaults block plain password logins.

The bottom line? Getting WordPress wp_mail() notifications, WooCommerce receipts, and password resets delivered reliably through Microsoft 365 requires OAuth 2.0, Microsoft Graph API, or a properly aligned transactional relay—never disabling your organization's security controls.

Why Legacy Office 365 SMTP Tutorials Break on Modern Tenants

Out of the box, WordPress sends mail using PHP's mail() function via wp_mail(). Most web hosts either block outbound port 25 or send unauthenticated mail that Exchange Online Protection immediately quarantines.

So site owners install a WordPress SMTP plugin for Office 365 and plug in smtp.office365.com. Here's the catch: Microsoft 365 tenants now enforce Security Defaults, Conditional Access, and tenant-wide SMTP AUTH disabled states. Checking the Microsoft Learn Exchange Online documentation confirms that Basic Auth is deprecated—meaning plain-text password connectors are a dead end unless your IT admin explicitly carves out exceptions or switches to modern OAuth flows.

Choose the Right Sending Method for Microsoft 365

Before touching WordPress plugins, align with your IT administrator on how website emails should leave your domain. Picking the wrong method leads to broken tokens, rate-limit throttling, or unnecessary Entra ID permissions.

Sending Architecture Authentication Type Best For Key Caveat
Microsoft Graph API (Entra ID App) OAuth 2.0 (HTTPS port 443) Company sites using M365 mailboxes with blocked SMTP ports Client secrets expire (6–24 months) and must be rotated on schedule
SMTP AUTH with OAuth 2.0 XOAUTH2 on port 587 (STARTTLS) Plugins that require SMTP protocol with per-mailbox Modern Auth Requires IT to enable SmtpClientAuthenticationDisabled = false on that mailbox
Transactional Mailer Relay (SES, Postmark, Brevo) API key + custom subdomain DKIM/SPF WooCommerce stores, LMS alerts, or sites exceeding 30 emails/min Needs DNS records (e.g., mail.yourdomain.com) separate from M365

Notice how clean that separation becomes. If your site handles heavy customer enquiries, pair your mailer architecture with reliable form selection so submissions are always stored in the WordPress database as a safety net even if an OAuth token expires.

Three-step checklist: Identify the approved sending route and account; Follow current provider and plugin requirements; Verify sender identity and administrative ownership
A three-step checklist for authenticating WordPress email through Microsoft 365 without weakening tenant security.

Step-by-Step: Configure a WordPress SMTP Plugin for Office 365

Before installing a mail plugin or adding constants to wp-config.php, take a full backup and recovery snapshot. Then configure a dedicated service sender—such as wordpress@yourdomain.com—rather than tying website mail to an employee's personal inbox that disappears when staff leave.

  1. Create a scoped App Registration in Microsoft Entra ID: In the Azure/Entra portal, register a new application for your WordPress site. Copy the Application (client) ID, Directory (tenant) ID, and generate a Client Secret. Set a calendar reminder 30 days before the secret expiration date.
  2. Grant minimal API permissions: Grant only the exact permission your plugin requires (typically Mail.Send for Graph API or SMTP.Send for OAuth SMTP). Avoid broad tenant-wide mailbox read permissions unless explicitly needed, and restrict who can view plugin credentials using strict staff permissions.
  3. Connect your WordPress SMTP plugin: In a modern mailer plugin (such as FluentSMTP, WP Mail SMTP, or Post SMTP), select the Microsoft 365 / Outlook or Microsoft Graph driver, paste the Redirect URI into Entra ID, and authorize the service mailbox via OAuth.
  4. Lock the From address and Force From Name: Enable the plugin's Force From Email toggle so other plugins cannot spoof arbitrary sender addresses that Exchange Online will reject with 550 5.7.60 SendAsDenied.

Verify SPF, DKIM, DMARC, and Form Reply-To Behavior

Getting a "Test Email Sent" green banner in WordPress isn't the finish line. You need to confirm that Microsoft 365 signs the message properly and that replies go to the right inbox.

Let's check the three details that catch teams after launch:

  • Inspect raw email headers: Send a test message to an external Gmail or Outlook address, open Show Original / View Message Source, and confirm Authentication-Results shows spf=pass, dkim=pass, and dmarc=pass.
  • Fix contact form spoofing: Never set a contact form's From field to {visitor_email}. Keep From locked to wordpress@yourdomain.com and map {visitor_email} strictly to the Reply-To header.
  • Enable email logging and failure alerts: Turn on lightweight mail logs inside your SMTP plugin (with short retention for privacy) or configure a secondary fallback mailer so you know immediately if a rotated client secret breaks delivery.

Frequently Asked Questions

Can I use an Office 365 App Password with a WordPress SMTP plugin?

On most modern Microsoft 365 tenants, no. Microsoft has disabled Basic Authentication—including App Passwords—for Exchange Online SMTP in favor of OAuth 2.0 and Microsoft Graph API. Even if an older tenant still permits App Passwords, OAuth 2.0 is far safer and future-proof.

Why do I get a "SendAsDenied" error when WordPress sends through Microsoft 365?

A 550 5.7.60 SendAsDenied error happens when the authenticated Microsoft 365 account tries to send an email whose From header belongs to a different address (like admin@yourdomain.com or a contact form visitor's email). Turn on Force From Email in your WordPress SMTP plugin for Office 365 or grant explicit Send As rights in Exchange Admin Center.

Should I use a shared mailbox or a licensed user account for WordPress SMTP?

A dedicated licensed service account—or a Microsoft Graph setup with proper application permissions—is easier to audit and isolate. While shared mailboxes can be used with Send As permissions granted to an authenticated service user, never tie your WordPress site to a personal staff mailbox whose password changes or gets deactivated.