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

Please check out Client was not authenticated to send anonymous mail through Office 365 for the latest information on this topic.

A client of ours that uses Office 365 Enterprise is generating an SMTP authentication error:

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 xxxxx.yyyyy.prod.outlook.com]

MailMessagemessage = newMailMessage();

message.From = newMailAddress(*** Email address is removed for privacy ***);

message.To.Add(newMailAddress("*** Email address is removed for privacy ***"));

message.Subject = "Test message 07:22... Test message 07:22... Test message 07:22... ";

message.Body = "Test message 07:22... Test message 07:22... Test message 07:22... Test message 07:22... Test message 07:22... Test message 07:22... Test message 07:22... Test message 07:22... Test message 07:22... ";

SmtpClientsmtp = newSmtpClient();

smtp.Host = "smtp.office365.com";

smtp.Port = 587;

smtp.EnableSsl = true;

smtp.DeliveryMethod = System.Net.Mail.SmtpDeliveryMethod.Network;

smtp.UseDefaultCredentials = false;

smtp.Credentials = newNetworkCredential(*** Email address is removed for privacy ***", "Password");

smtp.Timeout = 600000;

smtp.Send(message);

Obviously email and password changed.  We have verified the password is good using OWA.  We have this exact code working for several clients that are using non-Enterprise Office365 and Exchange 2016.

We will look at the logs today when onsite, but are looking for help.  We have viewed on several posts that people have gotten this error and by simply changing the password and changing it back it clears.  This is not the case for us.

Answer
Answer

Thanks for your timely response.  Yes it is a third party webservice we have developed.  Fortunately (or maybe unfortunately) we found the issue yesterday.  The IT staff set up the email as a shared mailbox instead of an account.  SMTP appears to only work when it is an actual account.  It would've been nice to get a better error message in return, but at least all is running once it was converted to an account.

Thanks for all the help.

1 person found this reply helpful

·

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 September 18, 2023 Views 11,674 Applies to: