Quantcast
Channel: Exchange Server 2013 - Outlook, OWA, POP, and IMAP Clients forum
Viewing all articles
Browse latest Browse all 10580

How to get the PrimarySmtpAddress from a x.500 format address in outlook addin

$
0
0

Hello,

Here is my problem:  In my outlook addin, I am going to construct a MailItem  and send it. I assign the 'to' of the MailItem with a x.500 address, such as "EX:/o=ComTest/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=test@comtest.com228". This x.500 address is what I get from the outlook address book. Then I find that this address can not be resolved correctly.

Outlook.MailItem newmail = (Outlook.MailItem)app.CreateItem(Outlook.OlItemType.olMailItem);

newmail.to = "/o=ComTest/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=test@comtest.com228";

...// set other filed of the newmail

if(newmail..Recipients.ResolveAll())

     newmail.Send();

 After ReolvedAll() is called, I get such a recipient{ Address:/cn=Recipients/cn=test@comtest.com228, Name:/o=ComTest/ou=Exchange Administrative Group (FYDIBOHF23SPDLT, AddressEntry.AddressEntryUserType:olSmtpAddressEntry}.  But it should be a olExchangeUserAddressEntry addressEntry and should have a correct Address.

My question is: how could I get a correct Address(a real smtp address) from this x.500 address?

Thanks.


Viewing all articles
Browse latest Browse all 10580

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>