Fix it now · Microsoft Deadline Calendar

Send-MailMessage to smtp.office365.com stopped working

If a PowerShell provisioning script uses Send-MailMessage with a stored username and password against smtp.office365.com, it relies on SMTP AUTH Basic Authentication, which Microsoft disables by default for existing tenants at the end of December 2026. Move the script to OAuth-based sending or an approved relay, or stop emailing credentials and use self-service account claim.

Fix it now

  1. In the Exchange admin center, open the SMTP AUTH Clients Submission report and filter for Basic authentication to find every sender.
  2. Search your scripts for smtp.office365.com, Send-MailMessage, and stored mail credentials.
  3. Move each sender to OAuth. For internal-only bulk notices, evaluate Microsoft 365 High Volume Email. Hybrid campuses can relay through on-premises Exchange.
  4. Remove the stored password from the script and vault any remaining secret.
  5. Better yet: stop emailing passwords at all. Use first-time account claim so new users set their own credential.
  6. Microsoft considers Send-MailMessage obsolete; replace it with an OAuth-capable method such as Microsoft Graph sendMail.

Why this keeps happening

Send-MailMessage was the easy way to send a notice from a script, so it is everywhere in campus automation. It only speaks the authentication method Microsoft is switching off. See the full Microsoft Deadline Calendar.

What breaks next

  1. NextEnd of Dec 2026
    SMTP AUTH Basic Authentication disabled by default for existing Exchange Online tenants (admins can re-enable for now)
    Who it hits: Scripts that email new-account notices via smtp.office365.com with a stored username and password
    Source: Microsoft Exchange Team blog: Updated SMTP AUTH Basic Authentication deprecation timeline (Jan 27, 2026)
  2. AnnouncedH2 2027
    Microsoft announces the final removal date for SMTP AUTH Basic Auth
    Who it hits: Same
    Source: Microsoft Exchange Team blog: Updated SMTP AUTH Basic Authentication deprecation timeline (Jan 27, 2026)

You'll fix this one. There are more coming.

Find your next break date in about five minutes. Your answers are scored in your browser.

Run the 5-minute Microsoft Deadline Check

Questions

Is Send-MailMessage itself being removed?
Microsoft has marked it obsolete for years and doesn't recommend it. The hard break is the authentication method, not the cmdlet.
Where else might this be hiding?
Scheduled tasks, SQL Agent jobs, copier/scan-to-email devices, and vendor apps that send on your behalf.

Related fixes

Request a Demo