get sender's or receiver's email address

  • Thread starter elie chucrallah
  • Start date
E

elie chucrallah

Dear Sirs

I have reference to an outlook email item
1-How to get both the sender's and receiver's email addresses.
N.B. contact email address might not be found in my contact list

this is how i am referencing the email item
any other way is most welcomed

Set myOlApp = CreateObject("Outlook.Application")
Set myNameSpace = myOlApp.GetNamespace("MAPI")
Set MyNewFolder = myNameSpace.GetFolderFromID(Id)

For I = 1 To MyNewFolder.Items.Count
MyNewFolder.Items.Item(I)
next

2-How can i identify if this email was sent by me or to me ?

Best regards
Elie Chucrallah
 
S

Sue Mosher [MVP-Outlook]

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

For recipient addresses, you will need to iterate the Recipients collection.
 

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