Howto: Get email message in raw format?

  • Thread starter Thread starter Venketash \(Pat\) Ramadass
  • Start date Start date
V

Venketash \(Pat\) Ramadass

Hi,

I am writing an Outlook addin that needs to be able to read all parts of the
email message in its raw format, i.e. content/mime types/headers etc.
Probably as string. The result should look something similar to when you
save a message as a .eml in outlook express or when you use Outlook to look
at a message's Internet headers (Right-click on the message in outlook and
click on options), but containing all the message data.

So far the furthest I have come is using CDO and looping through the
message's fields. Although this contains what looks to be all the raw data,
none of the dividing text etc is present. I need the message in its
completely raw format.

I would have thought that this must be the simplest thing to do, so
apologies if I have missed something obvious. Any help would be appreciated
though.

Kind regards,

-Pat Ramadass
(e-mail address removed)
 
Outlook/Exchange don't save the complete information you are looking
for. Other than what's in the headers and other fields there's nothing
else you can get. Even with a special registry setting and Outlook
2003 you don't get the complete message stream.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Lead Author, Professional Outlook 2000 Programming, Wrox Press
Lead Author, Beginning VB 6 Application Development, Wrox Press
Attachment Options
http://www.slovaktech.com/attachmentoptions.htm
Extended Reminders
http://www.slovaktech.com/extendedreminders.htm
 
Hi Ken,

Thanks for your response. I got similar replies for Sue Mosher and some
others. Dmitry Streblechenko's Redemption
gives you the option of save as type olRFC822 which is what I needed
essentially, although having to save to a file is not ideal.

Regards,

-Pat
(e-mail address removed)

Ken Slovak - said:
Outlook/Exchange don't save the complete information you are looking
for. Other than what's in the headers and other fields there's nothing
else you can get. Even with a special registry setting and Outlook
2003 you don't get the complete message stream.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Lead Author, Professional Outlook 2000 Programming, Wrox Press
Lead Author, Beginning VB 6 Application Development, Wrox Press
Attachment Options
http://www.slovaktech.com/attachmentoptions.htm
Extended Reminders
http://www.slovaktech.com/extendedreminders.htm


Venketash (Pat) Ramadass said:
Hi,

I am writing an Outlook addin that needs to be able to read all parts of the
email message in its raw format, i.e. content/mime types/headers etc.
Probably as string. The result should look something similar to when you
save a message as a .eml in outlook express or when you use Outlook to look
at a message's Internet headers (Right-click on the message in outlook and
click on options), but containing all the message data.

So far the furthest I have come is using CDO and looping through the
message's fields. Although this contains what looks to be all the raw data,
none of the dividing text etc is present. I need the message in its
completely raw format.

I would have thought that this must be the simplest thing to do, so
apologies if I have missed something obvious. Any help would be appreciated
though.

Kind regards,

-Pat Ramadass
(e-mail address removed)
 
Did you mean handler for POP3/IMAP? Or do you mean it has to be
caught on the way in for delivery to the SMTP (Sendmail or Exchange)
server?

Just a side Q in case there are any MS people here: what is the rational
behind Outlook not keeping the 'whole' message as is? What does it drop
and why?

--
[email protected]

Ken Slovak - said:
That still won't get you the complete stream as it comes into Outlook,
it will only reconstitute what's there in Outlook. To get the complete
incoming stream you'd need to write an event handler for an SMTP
server and catch it there before it hits Outlook.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Lead Author, Professional Outlook 2000 Programming, Wrox Press
Lead Author, Beginning VB 6 Application Development, Wrox Press
Attachment Options
http://www.slovaktech.com/attachmentoptions.htm
Extended Reminders
http://www.slovaktech.com/extendedreminders.htm


Venketash (Pat) Ramadass said:
Hi Ken,

Thanks for your response. I got similar replies for Sue Mosher and some
others. Dmitry Streblechenko's Redemption
gives you the option of save as type olRFC822 which is what I needed
essentially, although having to save to a file is not ideal.

Regards,

-Pat
(e-mail address removed)
 
This is a peer to peer group, so you most likely won't get any answers
from any MS people.

If you are using an SMTP server that supports it you can write an
event sink for the server that gets the message stream. For example
using Exchange 2000 and the Windows 2000 SMTP server. That's before it
gets into the Exchange server. For other servers you might have to
write your own SMTP server and set Outlook to use that. Your server
would then download the emails. That's what software for many AV
products do when they scan incoming emails.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Lead Author, Professional Outlook 2000 Programming, Wrox Press
Lead Author, Beginning VB 6 Application Development, Wrox Press
Attachment Options
http://www.slovaktech.com/attachmentoptions.htm
Extended Reminders
http://www.slovaktech.com/extendedreminders.htm
 
Back
Top