Get SMTP address of sender in outlook 2003

  • Thread starter Thread starter Nagaraj
  • Start date Start date
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
 
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
 
Thanks for your information. The problem is solved by the following line

sender = Application.Session.CurrentUser.Address
 
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
 
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.
 
Back
Top