Retrieving information from incomming mail items.

  • Thread starter Thread starter Jan G. Thorstensen
  • Start date Start date
J

Jan G. Thorstensen

I am using Outlook2k and WinXP. When a new mail arrives,
I want to get some information like the name of the sender, what is
the subject and body text?

How can I retrieve such properties from the incoming mail item?

I thought this was a good place to start...
Private Sub Application_NewMail()
....code...
End Sub

Any suggestions or code sample is very much apprieciated.


Regards
Jan.
 
Am Sun, 17 Sep 2006 23:43:57 +0200 schrieb Jan G. Thorstensen:

NewMail fires only once for a bundle of messages. Instead you can use
ItemAdd, which fires for each message as long as there´re not more than 16
at once.

That event has an Item argument, which is a reference to the incoming
message. Simply read its SenderName (that´s the sender´s display name),
Subject and Body properties.

In OL 2000 there´s no way to read the Sender´s address directly. For that
you´d need CDO 1.21 or Redemption (www.dimastr.com).
 

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

Back
Top