Provider setup

Microsoft 365 / Outlook SMTP test — ports, modern auth, and app passwords

Test Microsoft 365 and Outlook.com SMTP at smtp.office365.com on port 587 with STARTTLS. App passwords, OAuth2 deprecation, and 535 error fixes.

4 min read Credentials redacted No signup

Connection settings

Host
smtp.office365.com
Port
587
Security
STARTTLS

Microsoft 365 (formerly Office 365) and Outlook.com share the same SMTP submission endpoint: smtp.office365.com on port 587 with STARTTLS. The SMTP username is your full email address, and the password depends on your tenant's authentication policy — either an app password or an OAuth2 token.

Recommended settings

App passwords vs OAuth2

Microsoft is deprecating basic authentication (username + password) for SMTP AUTH across all Microsoft 365 tenants. The timeline:

To check if basic auth is allowed for your mailbox, an admin can run:

Get-CASMailbox -Identity [email protected] | Select SmtpClientAuthenticationDisabled
        

If the value is True, SMTP AUTH with username/password is blocked for that mailbox.

Generating an app password

If MFA is enabled on the account and basic auth is allowed:

  1. Go to mysignins.microsoft.com/security-info.
  2. Click "Add sign-in method" → App password.
  3. Name it (e.g. "SMTP Tester") and click Next.
  4. Copy the generated password immediately — it is shown only once.
  5. Use this as the SMTP password.

If you do not see the "App password" option, your admin has disabled app password creation in the Azure AD tenant settings.

Testing with SMTP Tester

  1. Host: smtp.office365.com, port 587, security STARTTLS.
  2. Username: your full Microsoft 365 email address.
  3. Password: your app password (or account password if basic auth is still enabled).
  4. From: the same email address (must match the authenticated mailbox).
  5. To: any recipient.
  6. Click Run. A 235 2.7.0 Authentication successful confirms login.

A 250 2.0.0 OK after DATA means Microsoft accepted the message for delivery.

Common errors

535 5.7.139 "Authentication unsuccessful, SmtpClientAuthentication is disabled"

SMTP AUTH has been disabled for this mailbox by an admin policy. The connection, TLS, and credentials may all be correct — but the tenant blocks password-based SMTP login.

Fix options:

535 5.7.3 "Authentication unsuccessful"

Credentials were rejected. Causes:

550 5.7.60 "SMTP; Client does not have permissions to send as this sender"

Authentication succeeded, but the From address does not match the authenticated mailbox and is not configured as a Send As alias. Microsoft 365 enforces strict sender identity.

Fix: set the From address to the same email you authenticated with, or configure Send As permission for the desired address in Exchange admin center.

Connection timeout

smtp.office365.com only accepts connections on port 587. Port 25 is for inbound relay (MX delivery to Exchange Online), not outbound submission. Port 465 is not supported. If 587 times out, check your network's outbound firewall rules.

Shared mailboxes and service accounts

Shared mailboxes in Microsoft 365 do not have passwords by default. To send via SMTP from a shared mailbox:

  1. Assign a password to the shared mailbox (convert to a regular mailbox, or set a password via PowerShell).
  2. Enable SMTP AUTH for that mailbox.
  3. Authenticate as the shared mailbox directly.

Alternatively, authenticate as a licensed user and set the From address to the shared mailbox — if Send As permission is granted.

For automated systems (applications, scripts, printers), Microsoft recommends either Direct Send (port 25 to your MX, no auth, internal recipients only) or the Microsoft Graph sendMail API with application permissions. SMTP AUTH remains an option for devices that cannot use modern auth (older printers, scanners, LOB applications).

Microsoft 365 sending limits

Exceeding these limits triggers throttling — SMTP returns 452 4.5.3 Too many recipients or 421 4.7.0 Temporary server error.

Security notes

Try it on your own server

Run these settings against your SMTP server and watch the live, credential-redacted protocol transcript.

Open SMTP Tester