views:

84

answers:

2

How can I read the HTML body from an Outlook.MSG file using Delphi code.

I have been using Scalabiums smmsg component, but it only the body text returns a value, the the html body property always returns an empty string.

Thanks,

Phillip.

+1  A: 

I've always had good luck using the Outlook Redemption library. Check it out here http://www.dimastr.com/redemption/

Peter Mourfield
A: 

Your question contains the .net tag so maybe this thread is helpful:

How to convert .msg to .eml

For example:

Save a mail as a file with MailMessage :

_SmtpClient.PickupDirectoryLocation = "C:\\";

_SmtpClient.DeliveryMethod = SmtpDeliveryMethod.SpecifiedPickupDirectory;

_SmtpClient.Send(_Mail);

Then, Indy (Internet Direct) can be used which provides a procedure in the TIdMessage class (unit IdMessage) to read a SMTP message from file

procedure TIdMessage.LoadFromFile(const AFileName: string; 
                                  const AHeadersOnly: Boolean = False);
mjustin