通过C#使用EWS委派用户

时间:2013-07-03 02:19:31

标签: c# delegates exchange-server impersonation exchangewebservices

我运行此代码,但它在我的Office 365 Exchange中没有执行任何操作,它没有将收件箱或传入的电子邮件发送给模拟用户。并没有给我任何错误。有人可以帮助我吗?或者想一想为什么这段代码不适合我的Office 365交换?

List<DelegateUser> newAllDelegates = new System.Collections.Generic.List<DelegateUser>();
DelegateUser AllDelegate = new DelegateUser(ImpersonatedEmail);
AllDelegate.Permissions.CalendarFolderPermissionLevel = DelegateFolderPermissionLevel.Editor;
AllDelegate.Permissions.InboxFolderPermissionLevel = DelegateFolderPermissionLevel.Editor;
AllDelegate.Permissions.TasksFolderPermissionLevel = DelegateFolderPermissionLevel.Editor;
AllDelegate.Permissions.ContactsFolderPermissionLevel = DelegateFolderPermissionLevel.Editor;
AllDelegate.Permissions.NotesFolderPermissionLevel = DelegateFolderPermissionLevel.Editor;
AllDelegate.Permissions.JournalFolderPermissionLevel = DelegateFolderPermissionLevel.Editor;
newAllDelegates.Add(AllDelegate);
Mailbox mbxPermitted = new Mailbox(_uid);
Collection<DelegateUserResponse> delReturn = service.AddDelegates(mbxPermitted, MeetingRequestsDeliveryScope.DelegatesAndSendInformationToMe, newAllDelegates);
System.Windows.Forms.MessageBox.Show("Editor Permission on All to " + ImpersonatedEmail + " On the Mailbox " + _uid + " Added.", "O365 Delegates: Success!");

0 个答案:

没有答案