如何在Exchange 2010中确定委派电子邮件的发件人

时间:2013-07-31 13:06:27

标签: c# exchangewebservices exchange-server-2010

我正在尝试通过Exchange Web服务找到一种方法来获取Exchange 2010中委派邮箱中项目发件人的名称。场景是许多代表可以访问共享收件箱并从该收件箱发送电子邮件作为所有者(即'messagingtest@onetwothree.com'),但我希望能够识别谁发送了特定的电子邮件。

我可以很好地掌握已发送的文件夹项目,但无法找到识别发件人的方法。

ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2010_SP2);
service.Credentials = new System.Net.NetworkCredential("AdministratorUsername", "AdministratorPassword", "onetwothree");
service.Url = new Uri("https://excas.onetwothree.local/EWS/Exchange.asmx");
service.AutodiscoverUrl("exadmin@onetwothree.com", RedirectionUrlValidationCallback);

Mailbox principal = new Mailbox("messagingtest@onetwothree.com");
Folder Ftest = Folder.Bind(service, new FolderId(WellKnownFolderName.SentItems, principal));
FindItemsResults<Item> findAltResults = service.FindItems(new FolderId(WellKnownFolderName.SentItems, principle), new ItemView(10));

foreach (Item SentItem in findAltResults.Items)
    {
        EmailMessage mss = (EmailMessage)SentItem;
        string Sender = mss.Sender.Name; // This just returns the mailbox principal, messagingtest@onewtothree.com, not j.johnson@onetwothree.com
    }

有什么想法吗?

0 个答案:

没有答案