Exchange Web Service API and 401 unauthorized exception

前端 未结 3 2099
难免孤独
难免孤独 2020-12-01 18:08

When I try sending email using the EWS API, I get the following error: (in message.Send();)

The request failed. The remote server returne

3条回答
  •  [愿得一人]
    2020-12-01 18:49

    This issue can cause the two way authentication provide by Microsoft office 365. Better create a app password and pass that instead of outlook password.

    exchangeService.Credentials = new WebCredentials("email", "app-pwd");
    

提交回复
热议问题