In my VSTO Outlook 2007 plug-in, I am able to get the email address of a recipient which is an exchange user. But when I have the following case, it does not return me the smtp email:
- Add a new Outlook Contact item (in Outlook contacts).
- The email address of this Contact Item should be an email of an exchange user (any person of your organization, but that is an exchange user).
- Now when I select this Outlook contact as email recipient and in item send event I cannot get the smtp address.
Below is my code:
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;
Can anyone please help me about what property I should use in this case to get smtp email?
Address = "/o=INCORPORATION/ou=Exchange Administrative Group (XXXXXXXXXXXX)/cn=Recipients/cn=username"
– kavun