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?