The SMTP server requires a secure connection or the client was not authenticated.

Anonymous
2022-03-23T04:26:20.763+00:00

The server response was: 5.7.57 Client not authenticated to send mail. Error: 535 5.7.139 Authentication unsuccessful, the request did not meet the criteria to be authenticated successfully. Contact your administrator. [BL1PR13CA0211.namprd13.prod.outlook.com]
It's working fine on local development. but not working on the Azure web app service.

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,956 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Ali Sufyan Butt 86 Reputation points MVP
    2022-03-26T13:36:21.853+00:00

    Hi,

    Add below line above your code and it should work

    ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls |
    SecurityProtocolType.Tls11 |
    SecurityProtocolType.Tls12;

    Thanks

    0 comments No comments