Raymond Raymond

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

event 2021-09-05 visibility 208 comment 0 insights
more_vert
insights Stats

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 


More from Kontext
comment Comments
No comments yet.

Please log in or register to comment.

account_circle Log in person_add Register

Log in with external accounts