2

我已经设置了一个 Office365 设备邮箱,这样我就可以在 Outlook 中打开它(使用打开->其他用户的邮箱),但是我无法使用 C# EWS api 访问该邮箱。访问邮箱的代码:

_service.ImpersonatedUserId = new ImpersonatedUserId(ConnectingIdType.SmtpAddress, delegateBox);
 _inbox = Folder.Bind(_service, WellKnownFolderName.Inbox);

结果是以下异常:

Exception in ProcessWebException
Microsoft.Exchange.WebServices.Data.ServiceResponseException: The SMTP address has no mailbox associated with it.
at Microsoft.Exchange.WebServices.Data.ServiceRequestBase.ProcessWebException(WebException webException)
at   Microsoft.Exchange.WebServices.Data.ServiceRequestBase.GetEwsHttpWebResponse(HttpWebRequest request)
at Microsoft.Exchange.WebServices.Data.SimpleServiceRequestBase.InternalExecute()
at Microsoft.Exchange.WebServices.Data.MultiResponseServiceRequest`1.Execute()
at Microsoft.Exchange.WebServices.Data.ExchangeService.BindToFolder(FolderId folderId, PropertySet propertySet)
at Microsoft.Exchange.WebServices.Data.ExchangeService.BindToFolder[TFolder](FolderId folderId, PropertySet propertySet)
at Microsoft.Exchange.WebServices.Data.Folder.Bind(ExchangeService service, WellKnownFolderName name)
4

2 回答 2

0

检查delegateBox实际对应于该用户的电子邮件。请注意,用户的电子邮件可能与其“登录名 + 域”非常不同。

在测试委派/模拟访问时,我建议将委派/模拟帐户设置为 Outlook 中的附加邮箱。它将允许验证是否有对委派/模拟邮箱的实际访问,并查看实际的电子邮件地址。

于 2013-05-16T22:51:07.000 回答
0

资源帐户默认禁用,您无法登录。也许是这种情况。

为什么要冒充装备?

于 2016-06-07T09:49:01.937 回答