MaiItem Sender Name vs SenderAddress

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I tried using the object browser but could not clarify my question ...

The mailitem "SenderName" contains the sender's name, e.g., "John Doe". The
sender's address, e.g., "(e-mail address removed)" is also stored somewhere in the
mailitem. How do I extract the sender's address?

Thanks
 
In Outlook 2003, you can use the MailItem.SenderEmailAddress, but note that
it's subject to security prompts.

In earlier versions, there is no Outlook property that returns the sender's
email address. You can either use CDO (or Redemption to avoid security
prompts -- http://www.dimastr.com/redemption/) to get the From address or
use Outlook to get the Reply To address. Sample code at
http://www.outlookcode.com/d/code/getsenderaddy.htm

To get the SMTP address from an Exchange sender or recipient, use CDO or
Redemption and the PR_EMAIL (&H39FE001E) MAPI property to obtain the SMTP
address from the AddressEntry object. See
http://www.outlookcode.com/d/code/getsenderaddy.htm#redemption and
http://www.cdolive.com/cdo5.htm#EMailAddressOfSender for examples.
 
Back
Top