How to get sender e-mail address

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

How to get sender e-mail address
 
Marx


Guest



How to i get senders e-mail address from inbox e-mail.
I got sendername, to, bcc etc. but no sender e-mail?
Please help me.
Posted 22 Sep, 2005 11:15:08 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Marx.

You can use the code below. However a sender must be in the list of Outlook Contacts or Address Book. You can also read the PR_SENDER_EMAIL_ADDRESS property of a message using Extended MAPI.

if (selection.Count > 0)
{
olItem = selection.Item(1);
if (olItem is Outlook.MailItem)
{
mailItem = olItem as Outlook.MailItem;
string from = mailItem.SenderName;
olNamespace = olApp.GetNamespace("MAPI");
olSender = olNamespace.CreateRecipient(from);
if (olSender.Resolve())
MessageBox.Show(olSender.Address);
}
}
Posted 22 Sep, 2005 17:47:44 Top
Marx


Guest


Can you give me some Extended MAPI example or how to use it with add-in-experess.NET
Posted 28 Sep, 2005 12:03:10 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi, Marx.

OK. I will send you an example today.
Posted 29 Sep, 2005 08:00:13 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Marx, you can download the example here:
http://www.add-in-express.com/projects/getsenderemailexample.zip
Posted 29 Sep, 2005 09:28:55 Top