Smtp

Office 365 and Outlook SMTP settings

Short answer

Microsoft 365 (Office 365) SMTP uses smtp.office365.com on port 587 with STARTTLS and TLS 1.2 or later, logging in as a licensed mailbox. Outlook.com uses smtp-mail.outlook.com on port 587 and requires OAuth2. Microsoft will turn off Basic auth for SMTP AUTH by default at the end of December 2026, so devices and apps that only support a username and password need a connector-based relay or another SMTP service.

Last checked 16 November 2026

For Microsoft 365 (Office 365), set your app or device to smtp.office365.com, port 587, STARTTLS on, and log in with a licensed mailbox’s address and credentials. For Outlook.com and Hotmail, use smtp-mail.outlook.com on port 587 with OAuth2. The big change in 2026 is authentication: plain username and password logins are being switched off.

Office 365 SMTP settings

Setting Microsoft 365 (work or school) Outlook.com, Hotmail, Live
SMTP server smtp.office365.com smtp-mail.outlook.com
Port 587 (recommended) or 25 587
Encryption STARTTLS, TLS 1.2 or 1.3 STARTTLS
Username Full mailbox address Full address
Authentication OAuth recommended, Basic auth ending OAuth2 required
Limits 10,000 recipients a day, 30 messages a minute Personal account limits

Sources: Microsoft’s multifunction device and application guide and Outlook.com POP, IMAP and SMTP settings.

Port 465 is not supported. Microsoft’s own tip: if a device recommends or defaults to 465, it does not support the TLS versions client SMTP submission requires.

Before it works: enable SMTP AUTH on the mailbox

SMTP AUTH is disabled for Microsoft 365 organizations created after January 2020. If your login fails with 5.7.139 Authentication unsuccessful, an admin needs to enable “Authenticated SMTP” for the sending mailbox in the Microsoft 365 admin center (Users, Active users, the user, Mail, Manage email apps).

Security defaults in Microsoft Entra ID also block Basic auth for SMTP. If your tenant has them on, only OAuth will work.

The end of Basic auth for SMTP AUTH

Microsoft’s updated timeline, published January 2026:

  • Until December 2026: no change.
  • End of December 2026: Basic auth for SMTP AUTH is disabled by default for existing tenants. Admins can turn it back on.
  • New tenants after December 2026: Basic auth is unavailable by default. OAuth is the supported method.
  • Second half of 2027: Microsoft announces the final removal date.

Once Basic auth is off, logins fail with 550 5.7.30 Basic authentication is not supported for Client Submission. Plan the move now, especially for printers and older line-of-business apps that cannot do OAuth.

Sending from C# to Office 365

Microsoft does not recommend System.Net.Mail.SmtpClient for new code and points to MailKit. With MailKit:

using MailKit.Net.Smtp;
using MailKit.Security;
using MimeKit;

var message = new MimeMessage();
message.From.Add(new MailboxAddress("Acme Alerts", "alerts@contoso.com"));
message.To.Add(MailboxAddress.Parse("sam@example.com"));
message.Subject = "Nightly report";
message.Body = new TextPart("plain") { Text = "The report is attached to the dashboard." };

using var client = new SmtpClient();
await client.ConnectAsync("smtp.office365.com", 587, SecureSocketOptions.StartTls);
// OAuth: pass an access token from Microsoft Entra ID
await client.AuthenticateAsync(new SaslMechanismOAuth2("alerts@contoso.com", accessToken));
await client.SendAsync(message);
await client.DisconnectAsync(true);

Getting accessToken means registering an app in Microsoft Entra ID and requesting the https://outlook.office.com/SMTP.Send permission. Microsoft documents the flow in Authenticate an IMAP, POP or SMTP connection using OAuth.

If the From address is not the mailbox you logged in as, that mailbox needs Send As permission, or the message bounces with 5.7.60 Client doesn't have permissions to send as this sender.

Office 365 SMTP relay and Direct Send

For devices that cannot authenticate at all, Microsoft offers two other paths. Both use your tenant’s MX host, which looks like contoso-com.mail.protection.outlook.com.

SMTP relay (connector) Direct Send
Port 25 25
TLS Enabled (1.2 or 1.3) Optional
Authentication Static IP or TLS certificate on an inbound connector None
Sends to external recipients Yes No, internal only
Needs a licensed mailbox No No

SMTP relay needs an inbound connector in the Exchange admin center (Mail flow, Connectors) that trusts your office’s static, unshared public IP or a certificate for your domain. It cannot be used from third-party clouds such as Azure VMs. Add the IP to your SPF record so receivers trust it.

Direct Send delivers only to mailboxes in your own tenant. Microsoft says most customers do not need it and is working on disabling it by default.

Microsoft also lists High Volume Email for internal recipients and Azure Communication Services Email for external recipients as replacements for Basic auth SMTP. The printer and scanner guide compares these for office devices.

Common Office 365 SMTP errors

Error Cause
5.7.139 Authentication unsuccessful, SmtpClientAuthentication is disabled SMTP AUTH turned off for the tenant or mailbox
5.7.139 ... user is locked by security defaults Security defaults block Basic auth
550 5.7.30 Basic authentication is not supported Basic auth disabled, use OAuth
5.7.60 Client doesn't have permissions to send as this sender From address differs from the login
530 5.7.57 Client not authenticated to send mail No login, or login attempted without TLS, see this guide

A simpler path for app email

Microsoft 365 is built for people’s mailboxes. Using one to send app email means a licensed mailbox, OAuth token handling, 30 messages a minute and no per-message delivery events.

A transactional relay is easier for apps and devices. Mailcandor’s SMTP relay takes a username (mailcandor) and an API key over TLS on 465 or 587. No OAuth registration, no mailbox license, and you can send from any address on a domain you have verified. Keep Microsoft 365 for staff mail and point the app at the relay.

Questions

What is the SMTP server for Office 365?

smtp.office365.com, on port 587 with STARTTLS. Microsoft also accepts port 25, but 587 is recommended. Use the hostname, never an IP address.

What is the SMTP server for Outlook.com and Hotmail?

smtp-mail.outlook.com on port 587 with STARTTLS. Outlook.com requires Modern Auth (OAuth2), so a plain password will not work.

Does Office 365 SMTP support port 465?

No. Microsoft's documentation says that if a device defaults to port 465, it does not support the TLS versions that client SMTP submission needs. Use 587.

Is Office 365 SMTP AUTH being turned off?

Basic auth for SMTP AUTH will be disabled by default for existing tenants at the end of December 2026. Admins can re-enable it for now, and Microsoft will announce a final removal date in the second half of 2027. OAuth keeps working.

What are the Office 365 SMTP sending limits?

For client SMTP submission, Microsoft lists 10,000 recipients per day and 30 messages per minute per mailbox.

Related

Send with someone on your side.

Unlimited domains on every plan, a person before any block, and 3,000 emails a month free. Tell us what you send and we set you up within one business day.