Email Alias Not resolving



Our Project is a .Net windows application developed in C#. We have a
requirement in our project where we get the sender’s email address from teh
email message using the following code.
(string)olMailItem.get_Fields((int) 0x0C1F001E)

But we get the address as /O=ABCD/OU=ITLSHL/CN=RECIPIENTS/CN=Jayanthi_t and
not (e-mail address removed)

Please let us not how we can get the smtp address in .Net



Ken Slovak - [MVP - Outlook]

PR_SENDER_EMAIL_ADDRESS will give you the Exchange distinguished name if
sent within an Exchange organization, which is what you are seeing.

PR_SMTP_ADDRESS (0x39FE001E) has that information, but it's only available
for Recipient objects. So you are going to have to get the sender name, look
up that name in the Exchange GAL and then use
Outlook.NameSpace.CreateRecipient(name) to create a Recipient object, then
get that object in whatever other API or object model you are using and read
the PR_SMTP_ADDRESS field from that Recipient object. An alternative is to
create a dummy email, add that name to the Recipients collection of the
email, resolve the Recipient and then read the PR_SMTP_ADDRESS field.

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question