Following is my code.

 ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2007_SP1);

   service.TraceEnabled = true;

   service.Credentials = new WebCredentials("xx@xx.com", "xxxx123");

   service.Url = new Uri("https://mail.xxxxxx.com/EWS/Exchange.asmx");

   FolderView v = new FolderView(5);



   ServicePointManager.ServerCertificateValidationCallback = RemoteCertificateValidationCallback;



   service.FindFolders(WellKnownFolderName.Inbox, v);

   //Error on above line.

 I tried changing the code line as below and I get another Error ....

service.Credentials = new NetworkCredential("xx@xx.com", "xx","xxxxxxxx");

"The remote server returned an error: (401) Unauthorized."

 

How do i resolve.   and what is difference between NetworkCredential and WebCredentials ?

 

This is Resolved.

I figure out that the problem was in code line

service.Credentials = new NetworkCredential("xx@xx.com", "xx","xxxxxxxx");

Instead of xx@xx.com  it should be just username 'xx'.     That Solved.

Phew!!

Regards

相关文章:

  • 2021-07-31
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-20
猜你喜欢
  • 2021-09-26
  • 2022-12-23
  • 2021-09-06
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-23
相关资源
相似解决方案