BestPaid guides · Microsoft 365 · Exchange Online

SMTP AUTH Basic authentication is off by default from the end of December 2026: move your apps to OAuth or Microsoft Graph

Apps, scripts and devices that send mail through smtp.office365.com with a username and password stop working when Basic authentication is switched off in your tenant. Microsoft switches it off by default at the end of December 2026. Here is how to find what still uses it and move each sender to OAuth or Microsoft Graph.

Sources: the Exchange Team's updated SMTP AUTH timeline (January 27, 2026) and a Microsoft staff reply in its comments (November 19, 2026), the original announcement, Microsoft Learn's OAuth for IMAP, POP and SMTP, RBAC for Applications in Exchange Online and Send-MailMessage pages, and the Exchange Team's EWS retirement timeline. Checked on November 21, 2026. This page is our own summary; follow Microsoft's documentation for every detail.

What changes and when

WhenWhat happens
Until December 2026No change: SMTP AUTH with Basic authentication still works where it works today.
End of December 2026Basic authentication for SMTP AUTH is disabled by default in existing tenants. Admins can still turn it back on.
Tenants created after December 2026Basic authentication for SMTP AUTH is unavailable by default; OAuth is the supported method.
Second half of 2027Microsoft announces the final removal date.

SMTP AUTH itself stays: only signing in with a password goes away. Turning Basic authentication back on is a stop-gap until the final removal date, not a fix; a Microsoft staff member replying in the comments under the Exchange Team's post (November 19, 2026) says Microsoft will share the exact procedure.

What breaks

1. Find every sender

Each sender lands in one of three groups below: code you own, a vendor's product (ask the vendor for an OAuth version) or a device.

2. Code you own, option A: keep SMTP, switch to OAuth

Exchange Online accepts OAuth 2.0 tokens on SMTP AUTH through SASL XOAUTH2. System.Net.Mail.SmtpClient has no XOAUTH2 support, so .NET code moves to a library that has it, such as MailKit.

  1. Register an app in Microsoft Entra. For a service or scheduled job, add the application permission SMTP.SendAsApp (Office 365 Exchange Online) and have an admin grant consent. An app that signs in as the user uses the delegated scope https://outlook.office.com/SMTP.Send instead.
  2. For app-only access, an Exchange admin registers the app's service principal and gives it the mailbox:
    Connect-ExchangeOnline
    New-ServicePrincipal -AppId <APPLICATION_ID> -ObjectId <ENTERPRISE_APP_OBJECT_ID>
    Add-MailboxPermission -Identity "alerts@contoso.com" -User <SERVICE_PRINCIPAL_ID> -AccessRights FullAccess
    The Object ID comes from the Enterprise applications entry, not from App registrations; the wrong one makes sign-in fail. To send as another address, the sender also needs SendAs (Add-RecipientPermission).
  3. Request the token with the scope https://outlook.office365.com/.default and authenticate with XOAUTH2:
    using MailKit.Net.Smtp;
    using MailKit.Security;
    using Microsoft.Identity.Client;
    
    var app = ConfidentialClientApplicationBuilder.Create(clientId)
        .WithTenantId(tenantId)
        .WithCertificate(certificate)          // a certificate, not a password
        .Build();
    var token = await app
        .AcquireTokenForClient(new[] { "https://outlook.office365.com/.default" })
        .ExecuteAsync();
    
    using var smtp = new SmtpClient();
    await smtp.ConnectAsync("smtp.office365.com", 587, SecureSocketOptions.StartTls);
    await smtp.AuthenticateAsync(new SaslMechanismOAuth2("alerts@contoso.com", token.AccessToken));
    await smtp.SendAsync(message);             // a MimeKit MimeMessage
    await smtp.DisconnectAsync(true);

A rejected token ends with 535 5.7.3 Authentication unsuccessful; check the scope, the consent and the service principal registration first.

3. Code you own, option B: send through Microsoft Graph

If you'd rather drop SMTP altogether, Microsoft Graph sends mail over HTTPS: POST /users/{id}/sendMail with the Mail.Send application permission. Don't grant Mail.Send tenant-wide in Microsoft Entra ID (remove it if it's already granted): there it lets the app send as any user in the tenant. Give it through RBAC for Applications in Exchange Online instead: an Exchange admin registers the app's service principal, as in option A, and assigns it the Application Mail.Send role scoped to the mailboxes it may send from. Microsoft says the two kinds of grants add up, so if Mail.Send is also granted in Entra ID, the scope restricts nothing.

var graph = new GraphServiceClient(
    new ClientCertificateCredential(tenantId, clientId, certificate));

await graph.Users["alerts@contoso.com"].SendMail.PostAsync(new SendMailPostRequestBody
{
    Message = new Message
    {
        Subject = "Nightly job finished",
        Body = new ItemBody { ContentType = BodyType.Text, Content = "All good." },
        ToRecipients = new List<Recipient>
        {
            new() { EmailAddress = new EmailAddress { Address = "ops@contoso.com" } }
        }
    },
    SaveToSentItems = false
});

In PowerShell, Microsoft marks Send-MailMessage as obsolete and says PowerShell has no immediate replacement for it; for Exchange Online, its documentation says you can use Send-MgUserMail from the Microsoft Graph PowerShell SDK.

Graph is also where EWS code has to go. Since October 1, 2026, Microsoft has been switching EWS off by default, in stages, in Exchange Online tenants that didn't choose to keep it on, and on April 1, 2027 EWS is switched off for good. If the same app uses both, move them together: see our EWS to Microsoft Graph guide.

4. Devices and products that can't do OAuth

Apps and scripts nobody wants to touch? We move them off SMTP passwords and EWS to OAuth and Microsoft Graph at a fixed price: a script or scheduled job from $690, an app or service from $1,490. One app gets a free estimate within 2 business days. We never ask for passwords, secrets or admin access: your admin registers the app and grants consent.
See the migration offer