我正在尝试使用 Exchange Web 服务获取电子邮件发件人的真实电子邮件地址,但是其中mailitem.Sender.Address包含以下内容 -
/O=EXCHANGELABS/OU=EXCHANGE ADMINISTRATIVE GROUP (...........)/CN=RECIPIENTS/CN=...........-.....
我怎样才能找到这封电子邮件发件人的真实电子邮件地址?
我的代码:
Dim sf As SearchFilter = New SearchFilter.SearchFilterCollection(LogicalOperator.And, New SearchFilter.IsEqualTo(EmailMessageSchema.IsRead, False))
Dim findResults As FindItemsResults(Of Item) = service.FindItems(WellKnownFolderName.Inbox, sf, New ItemView(128))
Dim items As ServiceResponseCollection(Of GetItemResponse) = service.BindToItems(findResults.Select(Function(item) item.Id), New PropertySet(BasePropertySet.FirstClassProperties, EmailMessageSchema.From, EmailMessageSchema.ToRecipients))
For Each itItem As Microsoft.Exchange.WebServices.Data.Item In findResults.Items
      If TypeOf itItem Is EmailMessage Then
            Dim mailItem As EmailMessage = DirectCast(itItem, EmailMessage)
然后我想参考mailItem.Sender.Address,其中包含上述字符串而不是abc@whatever.com
一些示例代码(最好在 中VB.NET)将不胜感激,因为我很难弄清楚这些 Exchange Web 服务是如何工作的。