【发布时间】:2011-09-07 08:38:19
【问题描述】:
在我的 VSTO Outlook 2007 插件中,我可以获取 Exchange 用户的收件人的电子邮件地址。但是当我遇到以下情况时,它不会给我返回 smtp 电子邮件:
- 添加新的 Outlook 联系人项目(在 Outlook 联系人中)。
- 此联系人项目的电子邮件地址应该是 Exchange 用户(您组织中的任何人,但那是 Exchange 用户)的电子邮件。
- 现在,当我选择此 Outlook 联系人作为电子邮件收件人并在项目发送事件中,我无法获取 smtp 地址。
下面是我的代码:
Recipient r = mailItem.Recipients[i];
r.Resolve();
//Note, i have different conditions that check the AddressEntryUserType of recipient's
//address entry object. All other cases work fine. In this case this is
//olOutlookContactAddressEntry.
//I have tried the following:
ContactItem cont = r.AddressEntry.GetContact();
string email = cont.Email1Address;
string emailtmp = r.AddressEntry.PropertyAccessor.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x800F101E") as string;
谁能帮助我了解在这种情况下我应该使用什么属性来获取 smtp 电子邮件?
【问题讨论】:
-
我也遇到了这个问题,无法从电子邮件或约会项目的收件人那里获取 smtp 地址。我只能得到一个看起来像这样的地址 -
Address = "/o=INCORPORATION/ou=Exchange Administrative Group (XXXXXXXXXXXX)/cn=Recipients/cn=username"
标签: ms-office vsto outlook-addin