Send & Receive Issues

Fix C# SMTP Office 365 Authentication and Send Errors

Steven ParkerSteven Parker Nov 2, 2026 870 views

Question details

A developer is unable to send emails via a C# application using SmtpClient through smtp.office365.com using port 587 and explicit credentials.

How to Fix C# SMTP Office 365 Authentication and Send Errors
Product
Microsoft Office 365
Device & OS
not provided
Scenario
Attempting to send programmatic emails from a custom C# .NET application using an Office 365 mailbox.
Observed behavior
The application fails to authenticate or send emails through the Office 365 SMTP server, despite providing correct explicit credentials and utilizing STARTTLS.
Before you start

Ensure you have administrator access to the Microsoft 365 admin center to verify tenant-level settings, and confirm you are using a licensed mailbox with a valid password.

Solution 1Recommended

Verify SMTP AUTH Status and Test in Outlook

Ensure that SMTP AUTH is enabled for the specific mailbox and verify the credentials by logging in directly.

Microsoft 365 disables SMTP AUTH by default for many tenants to improve security. If your code uses SmtpClient, this setting must be explicitly enabled for the sending account.

1
Open Active Users

Go to the Microsoft 365 admin center and navigate to Users > Active users.

2
Manage Email Apps

Select the user account being used for SMTP authentication. Click on the Mail tab and select 'Manage email apps'.

3
Enable Authenticated SMTP

Ensure that the 'Authenticated SMTP' option is checked, then save your changes.

4
Test via Outlook Web

Log into Outlook on the web with the exact same credentials to verify the account is active, not blocked, and requires no immediate password resets.

Verify SMTP AUTH Status and Test in Outlook
Security Defaults Warning: If your Microsoft 365 tenant has Security Defaults enabled globally, basic authentication (including SMTP AUTH) is blocked. You may need to disable Security Defaults and use an App Password, or preferably migrate your code to use the Microsoft Graph API.
Free Microsoft Office alternative

Looking for a Reliable Office Alternative? Try WPS Office

While troubleshooting backend Microsoft 365 email integrations can be complex, handling daily documents shouldn't be. WPS Office is a lightweight, fully compatible, and free alternative to Microsoft Office.

Fully compatible with Microsoft Word, Excel, and PowerPoint formats.Free to use with a familiar, easy-to-navigate user interface.Lightweight installation that doesn't drain system resources.Built-in PDF editing and seamless cloud synchronization.
microsoft office alternative - wps office

Frequently Asked Questions

Why does my C# SmtpClient throw an authentication exception with Office 365?

This typically occurs because SMTP AUTH is disabled on the mailbox, the Microsoft 365 tenant has Security Defaults blocking basic authentication, or Multi-Factor Authentication (MFA) is enabled on the account without an App Password.

Should I continue using SmtpClient for new C# applications?

Microsoft currently recommends using the Microsoft Graph API instead of SmtpClient for sending emails in modern applications due to enhanced security, modern authentication support (OAuth 2.0), and better reliability.

What TLS version is strictly required for Office 365 SMTP?

Office 365 strictly requires TLS 1.2 or higher. Connections attempting to use TLS 1.0 or 1.1 will be rejected by the Exchange Online servers.