如何使用.Net/C#在Outlook中获取收件人的所有地址 [英] How to get all addresses of a recipient in Outlook using .Net/C#

查看:89
本文介绍了如何使用.Net/C#在Outlook中获取收件人的所有地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试获取Outlook中属于某个人的所有电子邮件ID.当我在Outlook中查看联系人属性时,可以看到列出的几个电子邮件地址-SIM,SMTP和smtp.有没有办法得到所有这些?我知道如何使用以下方法获取主要电子邮件地址:

I am trying to get all the email Ids that belong to a person in Outlook. When I look at a contacts properties in Outlook, I can see several email addresses listed - SIM, SMTP and smtp. Is there a way to get all of these? I know how to get the primary email address using:

recipient.AddressEntry.GetExchangeUser().PrimarySmtpAddress

,该地址似乎总是提供标有"SMTP"的电子邮件地址.我也需要"smtp"和"SIP"电子邮件地址.这是连接到Exchange服务器的Outlook 2010,所有用户仅是Exchange用户.

which always seem to give the email address marked "SMTP". I want "smtp" and "SIP" email addresses too. This is Outlook 2010 connected to Exchange server and all users are exchange users only.

先谢谢了 维克拉姆

推荐答案

知道了答案!感谢MethodMan指出正确的方向.

Got the answer! Thanks to MethodMan for pointing in the right direction.

const字符串PR_EMS_AB_PROXY_ADDRESSES =" http://schemas.microsoft.com/mapi/proptag/0x800F101E ";

const string PR_EMS_AB_PROXY_ADDRESSES = "http://schemas.microsoft.com/mapi/proptag/0x800F101E";

var addresses = recipient.AddressEntry.PropertyAccessor.GetProperty(PR_EMS_AB_PROXY_ADDRESSES);

这给出了联系人的所有可用地址的列表!

That gives the list of all available addresses for a contact!

这篇关于如何使用.Net/C#在Outlook中获取收件人的所有地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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