如何获得在EWS MAPI邮件的发件人? [英] How to get the sender of an e-mail in EWS MAPI?

查看:235
本文介绍了如何获得在EWS MAPI邮件的发件人?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是EWS托管API访问从Exchange Server的所有电子邮件由code。
我在循环中的邮箱和加载它们的所有项目:

I'm accessing all e-mails from Exchange Server by code using the EWS Managed API. I loop over all the items in the mailbox and load them:

item.Load()

我需要知道的项目/电子邮件的发件人。但我不知道如何访问具有信息属性。任何帮助是AP preciated。

I need to know the sender of the item/e-mail message. But I don't know how to access the property that has the information. Any help is appreciated.

推荐答案

这是我的解决方案:

EmailMessage mes = (EmailMessage)item;
TextBox1.Text = mes.Sender.Name;

加载项后,我只是把它强制转换为 EmailMessage 以访问的属性和方法。

这篇关于如何获得在EWS MAPI邮件的发件人?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆