My guess is the authentication error is due Microsoft disabling basic authentication. Please see the official documentation.
Issue in SMTP Package - Unable to send an smtp email through Microsoft office 365 outlook
We are encountering issues with the System.Net.Mail namespace while using.NET Core. We are using the settings for sending emails through SMTP, however, we are getting an error message that says:
The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.57 Client not authenticated to send mail. Error: 535 5.7.139 Authentication unsuccessful, SmtpClientAuthentication is disabled for the Mailbox. Visithttps://aka.ms/smtp_auth_disabledfor more information. [SN7PR04CA0176.namprd04.prod.outlook.com 2024-07-23T09:26:48.348Z 08DCA6DE59C0EC4A] System.Net.Mail.SmtpException: The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.57 Client not authenticated to send mail. Error: 535 5.7.139 Authentication unsuccessful, SmtpClientAuthentication is disabled for the Mailbox. Visithttps://aka.ms/smtp_auth_disabled for more information. [SN7PR04CA0176.namprd04.prod.outlook.com 2024-07-23T09:26:48.348Z 08DCA6DE59C0EC4A]
We have contacted the Outlook 365 Team regarding this issue, and they believe it is an SMTP package problem. Can anyone help us with this issue?