[英]Unable to access Exchange Equipment mailbox with EWS
I have setup an Office365 equipment mailbox, so that I can open it in outlook (using Open->Other User's Mailbox), but I am unable to access the mailbox using the C# EWS api. 我已经设置了Office365设备邮箱,以便可以在Outlook中打开它(使用“打开”->“其他用户的邮箱”),但是无法使用C#EWS api访问该邮箱。 Code to access the mailbox:
访问邮箱的代码:
_service.ImpersonatedUserId = new ImpersonatedUserId(ConnectingIdType.SmtpAddress, delegateBox);
_inbox = Folder.Bind(_service, WellKnownFolderName.Inbox);
The result is the following exception: 结果是以下异常:
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)
Check that delegateBox
actually corresponds to that user's email . 检查
delegateBox
实际上是否与该用户的email相对应。 Note that user's email can be VERY different from its "login name + domain". 请注意,用户的电子邮件与其“登录名+域”可能会非常不同。
When testing delegation/impersonation access, I recommend to set up delegated/impersonated account as an additional mailbox in Outlook. 测试委派/模拟访问时,建议将委派/模拟帐户设置为Outlook中的其他邮箱。 It will allow to verify there is an actual access to delegated/impersonated mailbox, and to see the actual email addresses.
它将允许验证对委派/模拟邮箱的实际访问权限,并查看实际的电子邮件地址。
Resources accounts are disabled by default to you cannot log in. Maybe this is the case. 默认情况下,资源帐户已禁用,您无法登录。也许是这种情况。
Why do you want to impersonate as an equipment? 您为什么要模拟为设备?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.