我得到这个错误,而试图accessin资源邮箱。 请任何一个帮助我在此。 我是新来的EWS。
我可以通过OWA(Outlook Web应用程序)来访问资源邮箱。 但我不是,因为它是共享邮箱此邮箱的所有者。
我的代码:
ServicePointManager.ServerCertificateValidationCallback = CertificateValidationCallBack;
ExchangeService newExchangeService = new ExchangeService (ExchangeVersion.Exchange2007_SP1);
newExchangeService.Credentials = new NetworkCredential(username, password, domain);
newExchangeService.AutodiscoverUrl(email-id, RedirectionUrlValidationCallback);
newExchangeService.ImpersonatedUserId = new ImpersonatedUserId(ConnectingIdType.SmtpAddress, email_which_i_want_to_access);
Folder visitorsFolder = Folder.Bind(newExchangeService, WellKnownFolderName.Inbox);
foreach (Folder childfolder in visitorsFolder.FindFolders(new FolderView(10)))
{
Console.WriteLine(childfolder.DisplayName);
}