access_time 13 days ago languageEnglish
more_vert

The SMTP server requires a secure connection or the client was not authenticated

visibility 12 comment 0

When sending emails via SMTP in .NET using Office/Microsoft 365 email account, you may encounter the following exception:

System.Net.Mail.SmtpException: The SMTP server requires a secure connection or the client was not authenticated

This problem is usually caused by Azure Security Defaults or MFA. You can use Microsoft Graph APIs to send emails securely: Send mail - Microsoft Graph v1.0.

Or if you have to use SMTP protocol, refer to the following article to fix it: Send Emails using Microsoft 365 in ASP.NET Core - Kontext.

Refer to the following article to learn more:
Python: Send Email via Microsoft Graph API 


info Last modified by Raymond 7 days ago
thumb_up 0

Subscribe newsletter

comment Comments

No comments yet.

This forum is for general programming, development related discussions.