office 365 smtp sending failed

I need to use a company shared account *** Email address is removed for privacy *** to send notifications. But fails all the time. I tried all possible codes with no luck.

So, I had a little suspicious about the account. Then I used my office 365 work account, and it is ok. But I still need to use the shared account.

The error information is as following:

Message = "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 [D*******8.na***11.prod.outlook.com]"

Please help!

            SmtpClient client = new SmtpClient(host, port);
            client.EnableSsl = true;
            client.DeliveryMethod = SmtpDeliveryMethod.Network;
            //client.UseDefaultCredentials = false;
            client.Credentials = new NetworkCredential(configuration["smtp:username"], configuration["smtp:password"]);

            await client.SendMailAsync(mailMessage);

Hi Wang,

I would like to know which method you are using to set up a device/application to send email using Office 365. Is it SMTP client submission or Direct send

However, based on error message your application does not support SMTP client submission to send email using shared mailbox credential since your application must logon to a mailbox to send a message. You can use Office 365 SMTP relay as a workaround.

For your reference see Error: Client was not authenticated to send anonymous mail during MAIL FROM

Best regards,
Shyamal
---------------------
* Beware of scammers posting fake support numbers here.

* We are happy and always here to help you, and share the Microsoft 365 for business online information with you.

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.

Thank you for your response.

My questions is that I can use one account to send mail, but with the same code, I can not send mail using another account (the password is right with no doubt). 

WangJiping

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.

Hi Wang,

Thanks for the reply. I would like to confirm the following information to better understand the problem:

May I double confirm whether you are using SMTP client submission method to send email or else? 

Is it shared account support@company.com assigned license  or without license mailbox?

Regarding "I can not send mail using another account (the password is right with no doubt)", do you mean that shared account support@company.com have separate login password or are using your own mailbox password?

Best regards,
Shyamal
---------------------
* Beware of scammers posting fake support numbers here.

* We are happy and always here to help you, and share the Microsoft 365 for business online information with you.

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.

Thanks for responding, to answer your questions.

  • I believe I am using SMTP client submission (not delay). I use the C# SmtpClient to send the  mail message.

            SmtpClient client = new SmtpClient(host, port);
            client.EnableSsl = true;
            client.DeliveryMethod = SmtpDeliveryMethod.Network;
            //client.UseDefaultCredentials = false;
            client.Credentials = new NetworkCredential(configuration["smtp:username"], configuration["smtp:password"]);

            await client.SendMailAsync(mailMessage);

  • *** Email address is removed for privacy *** and *** Email address is removed for privacy *** are both Office 365 Business Premium account, but Support account doesn't have OneDrive for Business service. I compared all the attributes/properties, no other difference. I can use two bowers respectively(Chrome and Firefox) to log in and send out emails successfully.


WangJiping

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.

Hi Wang,

Thanks for the update. Since the issue is bit strange therefore, I would like to request you please try to check this issue via using SMTP relay (Option 3) to see whether the problem still occurs.

Your patience and cooperation are highly appreciated. 

Best regards, 
Shyamal
---------------------
* Beware of scammers posting fake support numbers here.

* We are happy and always here to help you, and share the Microsoft 365 for business online information with you.

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.

Hi Wang,

I'm writing to follow up on this thread. If there are any updates on your side, please post back at your convenience.

Best regards, 
Shyamal
---------------------
* Beware of scammers posting fake support numbers here.

* We are happy and always here to help you, and share the Microsoft 365 for business online information with you.

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 October 5, 2023 Views 7,719 Applies to: