access_time 2 years ago languageEnglish
more_vert

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

visibility 100 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 2 years ago
thumb_up 0

Please log in or register to comment.

account_circle Log in person_add Register

Log in with external accounts

comment Comments
No comments yet.
recommendMore from Kontext