How to get all addresses of a recipient in Outlook using .Net/C#

点点圈 提交于 2020-01-16 00:36:10

问题


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

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.

Thanks in advance Vikram


回答1:


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

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!



来源:https://stackoverflow.com/questions/35410811/how-to-get-all-addresses-of-a-recipient-in-outlook-using-net-c

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!