【发布时间】:2016-08-23 23:31:21
【问题描述】:
根据系统管理员的说法,Exchange 2010 (SP3) 模拟已正确配置。
问题似乎出在代码上:
private static ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2010_SP2);
//service.Credentials = new NetworkCredential(user,password,domain) OK
//service.AutodiscoverUrl OK
...
service.ImpersonatedUserId = new ImpersonatedUserId(ConnectingIdType.SmtpAddress,usrEmail);
//create a contact and try to save it in a particular contacts subfolder
contact.Save(subfolder.Id);
这就是错误“提供的电子邮件地址无效”的地方。这对我来说真的没有意义,因为我提供了我知道 100% 有效的电子邮件地址。
我尝试用谷歌搜索,但我一点也不觉得幸运。
附:我用 ConnectingIdType.SmtpAddress 和 ConnectingIdType.PrincipalName 尝试了各种模拟场景,没有区别。
知道如何解决这个问题吗?非常感谢,提前。
【问题讨论】:
-
为组织中的所有用户配置的 Exchange 模拟 - 请参阅 msdn.microsoft.com/en-us/library/bb204095(exchg.140).aspx
标签: exchangewebservices impersonation ews-managed-api