Get SMTP address of sender in outlook 2003

N

Nagaraj

Hi,

I want to retrieve smtp address of sender in outlook 2003 plugin development

I used
mailItem.SenderEmailAddress
but it is not giving any value

In 2007 I got the value by
mailItem.SendUsingAccount.SmtpAddress;

How to get the same value in outlook 2003?

Thanks

Nagaraj
 
A

Ashutosh Jogdande

Hello Nagaraj,

You can get this by Using MAPI,
Or you can simply create one ContactItem and set Exchange address which you
are getting from mailItem.SenderEmailAddress
to "Email1Address" property of ContactItem, After saving this Outlook will
resolve smtp address for you. Now you will have smtp address in
"Email1DisplayName" Propery of ContactItem.
And dont forget to delete this created ContactItem (from deleted Items
also).

Thanks
Ashutosh
 
N

Nagaraj

Thanks for your information. The problem is solved by the following line

sender = Application.Session.CurrentUser.Address
 
D

Dmitry Streblechenko

That will give you the current user's address, but it has nothing to do with
the sender address of any particular message in your inbox.

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
Nagaraj said:
Thanks for your information. The problem is solved by the following line

sender = Application.Session.CurrentUser.Address
 
K

Ken Slovak - [MVP - Outlook]

And it also won't necessarily give you an SMTP address. If CurrentUser is an
Exchange DN that's what you'll get, not an SMTP address.
 

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

Top