Advanced add-in for Outlook using VC++/ATL (searching for hints and help)

H

Happy.Cerberus

I'm currently developing Outlook 2000, XP & 2003 add-ins for antivirus
software.

The required functionality is:

react to Sending mail event & New mail received event
parse the mail (get all attachments & check them)
modify the mail (remove infected attachments, add certificate, mangle
headers, etc...)

I'm already succesfully intercepting events and also doing some simple
parsing using the Outlook object model.

First problem is that i need to access mail headers (Read/Write) and
add attachments (certificates). The object model doesnt seem to be
succifient for this.

Second problem is with events. In Outlook 2003 i use NewMailEx event
which contains pointer to the received message, in Outlook 2000 & XP
i'm thinking about "Item Add" Items event, but dont know how to use it.

Thx for any help...
 
K

Ken Slovak - [MVP - Outlook]

The Outlook object model doesn't expose the message headers in emails. To
get those you need an API or object model that allows access to the
PR_TRANSPORT_MESSAGE_HEADERS property (0x007D001E). You can do that using
CDO 1.21 (optional installation for Outlook 2000 and later and that property
will fire the security prompts in secure versions of CDO/Outlook), or
Extended MAPI (C++ or Delphi only, long learning curve) or Redemption (3rd
party COM library at www.dimastr.com/redemption).

You can create MAPI x-headers using named MAPI properties, there's an
example of that using Redemption on the Redemption Web site. Those MAPI
properties are converted into x-headers when the item is sent, not before.
There's no other way I know of to do that directly since the message headers
are created when the item leaves the transport, after it's left Outlook.

There are examples of using an ItemAdd handler using VB at
www.outlookcode.com, search for ZapHTML for one example of that. There might
also be some C# and/or C++ examples there, I'm not sure about that. However
there are lots of other code samples for Outlook there.
 

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