Blog

Office 365 SMTP settings after basic auth ends

Thomas SchiavoneThomas Schiavone
Office 365 SMTP settings cover

You need the Office 365 SMTP settings for an app, a script, a WordPress plugin, or the scanner down the hall. They're in the first table below.

The catch: the username-and-password version of these settings stops working by default at the end of December 2026, when Microsoft turns off Basic authentication for SMTP AUTH in Exchange Online. Anything that signs in to smtp.office365.com with a mailbox password or an app password is on the list.

Office 365 SMTP settings

These are Microsoft's settings for SMTP AUTH client submission, the method where a device or app signs in to a Microsoft 365 mailbox and sends as that mailbox (Microsoft).

SettingValue
SMTP serversmtp.office365.com (use the name, not an IP address)
Port587 (recommended) or 25
EncryptionSTARTTLS, with TLS 1.2 or TLS 1.3
UsernameThe full email address of the sending mailbox
AuthenticationMailbox password (Basic auth) or an OAuth token
Sending limits10,000 recipients per day and 30 messages per minute, per mailbox

A few details trip people up:

  • Port 465 isn't supported. Microsoft says that if your device or app defaults to 465, it doesn't support the TLS versions client submission requires.
  • The From address has to match the mailbox. Sending as a different address needs Send As permission, or the message bounces with 5.7.60 SMTP; Client doesn't have permissions to send as this sender.
  • SMTP AUTH has to be on for the mailbox. It's off for organizations created after January 2020, and it's off when security defaults are enabled in Microsoft Entra ID (Microsoft).
  • The limits are per mailbox. Hit 10,000 recipients and that mailbox can't send again until its 24-hour window rolls forward. Microsoft says plainly that Exchange Online isn't built for bulk sending (Microsoft).

If your config has those values and a password field, you're using Basic auth. That's the part that changes.

What changes at the end of December 2026

Microsoft's Exchange Team published the updated timeline in January 2026 (Exchange Team blog):

WhenWhat happens
Now to December 2026SMTP AUTH Basic auth works as it does today.
End of December 2026Basic auth for SMTP AUTH is disabled by default for existing tenants. Admins can turn it back on.
Tenants created after December 2026Basic auth for SMTP AUTH is unavailable by default. OAuth is the supported method.
Second half of 2027Microsoft announces the final removal date.

What breaks: anything that sends a username and password to smtp.office365.com. That includes app passwords: an app password is still a password sent over Basic auth, so it stops working when Basic auth does. Microsoft's general guidance on retiring Basic auth makes the same point about app passwords (Microsoft).

What keeps working: SMTP AUTH with OAuth, SMTP relay through a connector, and API-based sending like Microsoft Graph. None of those send a mailbox password. Direct send doesn't use a password either, but it's on its way out too (more on that below).

What happens on the day

As of early December 2026, Microsoft hasn't published the exact day or the steps to turn Basic auth back on. Here's what's confirmed:

  1. Your existing tenant gets Basic auth for SMTP AUTH turned off by default.
  2. Every app, script, and device still sending a password gets an authentication error instead of a sent message.
  3. An admin can turn Basic auth back on.

That last step is a stopgap. Microsoft will name a final removal date in the second half of 2027, and after that there's nothing to turn back on. Treat the re-enable switch as runway for the senders you missed, not as a plan.

Find out if you're affected

Start with your own code and config. Search for the hostname:

Terminal
grep -rnI "smtp.office365.com" --exclude-dir=node_modules --exclude-dir=.git .

That covers config in any file format, from .env and YAML to .config, .properties, and .ini. It can't see settings stored in a database or an admin screen, and that's where a lot of senders keep them: WordPress SMTP plugins save to the database, and SaaS tools keep credentials in their own settings pages.

So make a list of everything that stores a mailbox password: WordPress SMTP plugins, multifunction printers and scanners, monitoring and backup tools, ERP and line-of-business apps, cron scripts, and SaaS tools where someone pasted in "the noreply mailbox" credentials years ago.

If you're the Microsoft 365 admin, Exchange Online PowerShell tells you where SMTP AUTH is allowed. Check the organization setting first:

PowerShell
Get-TransportConfig | Format-List SmtpClientAuthenticationDisabled

Then list the mailboxes that override it and turn SMTP AUTH on:

PowerShell
$Users = Get-CASMailbox -ResultSize unlimited
$Users | where {$_.SmtpClientAuthenticationDisabled -eq $false}

Those mailboxes are your candidates. To see which ones actually sign in with a password, open Entra ID > Monitoring & health > Sign-in logs, add the Client App column, and filter to the legacy authentication protocols (Microsoft). Every hit there is a sender to fix.

Your options for sending through Microsoft 365

Microsoft documents several ways for devices and apps to send email with Microsoft 365, and recommends High Volume Email and Azure Communication Services Email as alternatives to SMTP AUTH with Basic auth (Microsoft).

OptionHow it authenticatesWho it can send toWhat you need
SMTP AUTH with OAuthOAuth token over smtp.office365.comInside and outside your orgAn app registered in Microsoft Entra, SMTP.Send or SMTP.SendAsApp, and a client that speaks XOAUTH2
SMTP relay (connector)TLS certificate or static IP on an inbound connectorInside and outside your orgPort 25, a certificate or a static IP not shared with another org, and an inbound connector
Direct sendNone (treated like anonymous internet mail)Your Microsoft 365 mailboxes onlyPort 25, plus SPF, DKIM, and DMARC set up for your domain
High Volume Email (HVE)HVE account credentials or OAuthInternal recipients onlyAn HVE account and a pay-as-you-go billing policy
Microsoft Graph sendMailOAuth (Mail.Send) over HTTPSInside and outside your orgAn Entra app and code that calls an API instead of SMTP
Azure Communication Services EmailThrough your Azure Communication Services resourceInside and outside your orgAn Azure resource and a sending domain (Azure-managed or your own)

A few specifics that change the decision:

  • OAuth for SMTP supports app-only auth. Your app can use the client credentials flow with the SMTP.SendAsApp permission, then an admin registers the app's service principal in Exchange with New-ServicePrincipal and grants it access to the mailbox with Add-MailboxPermission (Microsoft). It works, but there are a lot of steps, and your SMTP library has to support XOAUTH2.
  • SMTP relay can't run from a third-party host. Microsoft says you can't relay from a service like Microsoft Azure through Microsoft 365. Relay is for devices and servers on your own network.
  • Don't build on direct send. Microsoft says most customers don't need it and that it's working on an option to turn direct send off by default (Microsoft). Admins can already block it: Set-OrganizationConfig -RejectDirectSend $true rejects anonymous mail from your own domains that doesn't match an inbound connector (Microsoft), and that setting became generally available for worldwide tenants in November 2026 (Exchange Team blog). If a printer uses direct send today, move it to relay.
  • HVE is internal only, and it isn't free. No rate limits and up to 50 recipients per message, billed per recipient through Microsoft 365 pay-as-you-go, and it can't reach a customer's Gmail address (Microsoft).

Which option fits your sender

Match the fix to what's sending and who's receiving.

A printer or scanner on your network. Use SMTP relay with a certificate-based connector, or an IP-based one if the device can't present a certificate. Point the device at your MX endpoint (for example, contoso-com.mail.protection.outlook.com) on port 25. Relay needs neither a password nor OAuth support on the device, and older hardware usually has neither. Skip direct send, even if scans only go to staff: Microsoft is moving to turn it off by default.

An internal app that emails staff. Payroll alerts, IT monitoring, helpdesk updates. Use HVE with OAuth. It's built for this, keeps app mail out of user mailboxes, and has no per-minute limit. You pay per recipient, so check the volume before you move a chatty monitoring tool onto it.

A script or internal tool you own. Switch to SMTP AUTH with OAuth if your library supports XOAUTH2, or call Graph sendMail if you'd rather work with an HTTP API. Either way, the app gets its own identity instead of borrowing a person's password.

A product that emails your customers. Password resets, receipts, alerts, verification codes. Move it off Microsoft 365 entirely. This mail was never a good fit for a staff mailbox, and the December change is a good excuse to fix it.

One caveat: if your scanner sends through a cloud-hosted print service, relay is out, because Microsoft doesn't support relaying from third-party hosts. Use OAuth SMTP if the service supports it, or HVE if it only sends to staff.

Move product email off a staff mailbox

Most of what breaks in December isn't the scanner. It's product email: the password reset, the order confirmation, the "your export is ready" message, all sent from noreply@yourcompany.com through a Microsoft 365 mailbox someone set up years ago.

That setup has problems that have nothing to do with Basic auth. It caps you at 10,000 recipients a day per mailbox. It ties customer-facing deliverability to the same tenant your staff uses. And it means a password reset depends on one shared password nobody wants to rotate.

The fix is a transactional email service: Amazon SES, SendGrid, Postmark, or Resend. You authenticate with an API key, verify your sending domain with SPF and DKIM, and get volume limits built for app email. Microsoft 365 goes back to being email for people.

If you'd rather stay inside Microsoft, Azure Communication Services Email is the option Microsoft points to for external recipients. It's one sending service, so failover to a second provider, templates your team edits without a deploy, and SMS or in-app messages are still separate pieces you'd add.

Courier sits on top of those providers. You connect one or more of them, keep your templates in one place, and send from your app with one call:

JavaScript
import Courier from "@trycourier/courier";

// Reads your API key from the COURIER_API_KEY environment variable
const courier = new Courier();

await courier.send.message({
  message: {
    to: { email: "jordan@example.com" },
    template: "password-reset",
    data: {
      name: "Jordan",
      resetUrl: "https://app.example.com/reset?token=abc123",
    },
  },
});

In the template, {{data.name}} and {{data.resetUrl}} fill in from the data object. Connect a second provider and Courier fails over to it when the first one returns an error. Every message shows up in Courier's logs with its delivery status, so "did the reset email go out?" has an answer. When you're ready, the same send can add SMS, push, or an in-app message.

One thing to know if you already use Courier: the SMTP integration takes a host, username, and password, so if it points at smtp.office365.com with an app password, it's affected the same way as everything else. Swap it for a transactional provider before the end of December.

Wrapping up

  • The Office 365 SMTP settings are smtp.office365.com, port 587, STARTTLS, and a mailbox sign-in.
  • At the end of December 2026, Basic auth for SMTP AUTH turns off by default for existing tenants. App passwords stop working with it.
  • Admins can turn Basic auth back on for now, but Microsoft will announce a final removal date in the second half of 2027.
  • Printers and scanners go to SMTP relay. Internal app mail goes to HVE or OAuth. Customer email goes to a transactional provider.

Start this week with the grep and the sign-in logs. The list of senders is always longer than you expect, and finding them now beats finding them through a ticket about missing password resets. If you're moving product email, connect a provider in Courier and send your first message from your app instead of a mailbox. If you hit a 535 error on the way, here's what it means, and the SMTP error code reference covers the rest.

Frequently asked questions

What are the Office 365 SMTP settings?

Use smtp.office365.com as the server, port 587, and STARTTLS with TLS 1.2 or 1.3. Sign in with the full email address of the sending mailbox. Each mailbox can send to 10,000 recipients per day and 30 messages per minute.

Does smtp.office365.com still work after December 2026?

Yes, with OAuth. What changes is Basic auth: at the end of December 2026, Microsoft disables username-and-password sign-in for SMTP AUTH by default on existing tenants. Admins can turn it back on until Microsoft's final removal date, which it plans to announce in the second half of 2027.

Do app passwords work with Office 365 SMTP?

Only while Basic auth is on. An app password is a password sent over Basic auth, so it stops working when Basic auth for SMTP AUTH is disabled. Move the app to OAuth, SMTP relay, or an API-based provider.

What does "535 5.7.139 Authentication unsuccessful" mean?

Exchange Online rejected the sign-in, and the text after the code names the reason. Read that reason before you change anything, because 5.7.139 covers more than one cause. For this error and the related 535 5.7.3 Authentication unsuccessful and 5.7.57 Client not authenticated to send mail, Microsoft's troubleshooting steps start with three checks: SmtpClientAuthenticationDisabled on the mailbox, security defaults, and any Conditional Access policy that blocks legacy authentication (Microsoft). If one of those is blocking password sign-in, move the sender to OAuth or another method instead of turning it back on.

What's the difference between SMTP AUTH and an Office 365 SMTP relay?

SMTP AUTH signs in to a mailbox at smtp.office365.com on port 587 and sends as that mailbox. An Office 365 SMTP relay uses an inbound connector instead: your device connects to your MX endpoint on port 25 and proves who it is with a TLS certificate or a static IP address. Relay doesn't need a licensed mailbox or a password, but it can't be used from a third-party cloud host.

Can I use port 465 with Office 365 SMTP?

No. Microsoft supports port 587 (recommended) or 25 for client submission. If a device or app only offers 465, Microsoft says it doesn't support the TLS versions client submission requires.