Can't get the SMTP address for the

Add-in Express™ Support Service
That's what is more important than anything else

Can't get the SMTP address for the
 
advantest


Guest


Dear Team

My outlook addin faces a bug. The addin will try to get the SMTP addresses of recipients before sending out the email. It works fine while searching the Exchange Email Account(my company uses Office365) and external SMTP address entered directly.

1. AA.BB@companydomain.com => OK
2. AA.BB@gmail.com => OK

But, based on business request, we add some external address into our Exchanger Server as Contact.
For example,

3. AA.BB@DCompany.com => we add it as a contact in exchanger server and hide it in Global Address List(check "Hiden in the Address List" option)

When use send email directly to this AA.BB@DCompany.com, the addin will report an error message:
"The property "http://schemas.microsoft.com/mapi/proptag/0x39FE001E" is unknown or cannot be found"

By viewing the code and debug, this address's AddressEntry.AddressEntryUserType is OlAddressEntryUserType.olExchangeUserAddressEntry. So it will try to get email address by:

string address = rpt.AddressEntry.GetExchangeUser().PrimarySmtpAddress;
if (string.IsNullOrEmpty(address))
{
const string PR_SMTP_ADDRESS =
"http://schemas.microsoft.com/mapi/proptag/0x39FE001E";
Outlook.PropertyAccessor pa = rpt.PropertyAccessor;
ml.Add(new MailAddressItem(rpt.Name, pa.GetProperty(PR_SMTP_ADDRESS).ToString()));
}
else
{
ml.Add(new MailAddressItem(rpt.Name, address));
}

The PrimarySmtpAddress is empty.

Can you help us to find a better solution to search this kind of email address?
Posted 18 Sep, 2016 04:42:08 Top
Andrei Smolin


Add-in Express team


Posts: 18794
Joined: 2006-05-11
Hello,

advantest writes:
we add it as a contact in exchanger server and hide it in Global Address List(check "Hiden in the Address List" option)


I assume you use the "Hide from Exchange Address Lists" option; you can find a description of this option at https://supertekboy.com/2014/07/03/hide-mail-contact-from-global-address-list/. I believe the goal of using this feature is to prevent users from getting a hidden email address(es); you are a user as well. This explains why calling ExchangeUser.PrimarySmtpAddress returns an empty string. Also, I think that ExchangeUser.PrimarySmtpAddress internally calls pa.GetProperty(PR_SMTP_ADDRESS).


Andrei Smolin
Add-in Express Team Leader
Posted 19 Sep, 2016 04:40:44 Top