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:
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?
Select the recipients you want, add them to the list, and then select OK. You can also search for a specific recipient by typing the recipient's name in the search box and then selecting Search . The Full Access permission allows a delegate to open a user's mailbox and access the contents of the mailbox.
Open the modern EAC at https://admin.exchange.microsoft.com, expand Mail flow, and then select Message trace.
They cannot access your personal email, unless they also have access to the machine you work on.
However, unlike a mail contact, a mail user has sign in credentials in your Microsoft 365 organization and can access resources. For more information about mail contacts and mail users, see Recipients in Exchange Online.
I have found a way to use the ExchangeUser item and resolve the smtp address through that object. This post helped - Get Smtp email from ContactInfo stored in Exchange
foreach (Outlook.Recipient recipient in currentAppointment.Recipients)
{
Outlook.ExchangeUser exchangeUser = recipient.AddressEntry.GetExchangeUser();
string smtpAddress;
if (exchangeUser != null)
{
smtpAddress = exchangeUser.PrimarySmtpAddress;
}
else
{
smtpAddress = recipient.Address;
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With