Microsoft 365 Security Info Error

When I used my 365 account to navigate to page: https://mysignins.microsoft.com/security-info

It shows the following error: 

An unexpected error has occurred

And also I could not use email in .NET applications to send emails automatically which I suspect it has something to do with this error too:

"SmtpConfig": {

        "FromEmail": "*** Email address is removed for privacy ***",

        "FromEmailDisplayName": "....",

        "EnableSSl": "true",

        "Host": "smtp.office365.com",

        "Password":"...."

        "Port": "587",

        "UserName": "*** Email address is removed for privacy ***"

      }

using (var client = new SmtpClient())

                {

                    var config = smtpConfig;


                    if (config.EnableSSl)

                        client.EnableSsl = true;

                    client.Host = config.Host;

                    client.Port = config.Port;

                    client.DeliveryMethod = SmtpDeliveryMethod.Network;

                    client.Credentials = new NetworkCredential(config.UserName, rootConfig[config.PasswordConfigurationName]);

                    client.UseDefaultCredentials = false;


                    await client.SendMailAsync(message);

     

                }

Error message:

System.Net.Mail.SmtpException: The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.57 SMTP; Client was not authenticated to send anonymous mail during MAIL FROM [ME2PR01CA0057.ausprd01.prod.outlook.com] at System.Net.Mail.MailCommand.CheckResponse(SmtpStatusCode statusCode, String response) at System.Net.Mail.MailCommand.EndSend(IAsyncResult result) at System.Net.Mail.SendMailAsyncResult.SendMailFromCompleted(IAsyncResult result) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw(Exception source) at System.Net.Mail.SendMailAsyncResult.End(IAsyncResult result) at System.Net.Mail.SmtpClient.SendMailCallback(IAsyncResult result) --- End of stack trace from previous location where exception was thrown --- at

Any suggestions?

Answer
Answer

Hi Raymond Tang,

Thanks for your post with above details. I just tested this on my side and I can access the site you mentioned without any errors, please see: 


Given this result, please kindly try it again with a different browser and the browser's InPrivate mode to see if there is the same result.

Moreover, about the problem that you cannot use email in .NET applications to send emails, based on the information you shared, you are using the option 1 SMTP client submission as described in below picture, right?

Option 1 (recommended): Authenticate your device or application directly with a Microsoft 365 or Office 365 mailbox, and send mail using SMTP AUTH client submission

If so, please kindly refer to the article I shared above to make sure you have correctly set up your .NET application to send emails via SMTP client Submissio.

Also, based on the error message, you need to check if you have entered the correct credentials in your .NET application.

Moreover, please make sure you have assigned a license to the mailbox that you used to send emails, also, make sure you didn't enable MFA for this account. Besides, your device must be able to use TLS version 1.2 and above.

Best regards,

Jennifer

Thanks I resolved both issues by using the following approach:

  • Turn off Modern authentication and turn it on.
  • Turn on Modern authentication but untick 'Authenticated SMTP' Used by ‎POP‎ and ‎IMAP‎ clients to send email messages.'
  • Tick user mailing app settings 'Authenticated SMTP'
  • In Modern authentication, tick 'Authenticated SMTP' Used by ‎POP‎ and ‎IMAP‎ clients to send email messages.'

So for some reason I have to repeat these steps to make everything work.

And literally I only changed user email setting for 'Authenticated SMTP'

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

 
 

Question Info


Last updated April 11, 2024 Views 1,470 Applies to: