0
votes

I want to convert an MSG file (Outlook mail message saved as a file) to an EML (RFC822) file. I'd also like to reverse the procedure and convert the resultant EML file back to MSG. From what I read, I can do this with Redemption via VBScript.

I don't have or desire to have Outlook installed, so I installed Microsoft Exchange Server MAPI Client and Collaboration Data Objects 1.2.1 on my Windows 64-bit machine as recommended on the Redemption page. I'm trying to run the following code:

Set session = CreateObject("Redemption.RDOSession")
Set msg = session.GetMessageFromMsgFile("c:\temp\mail.msg", false)
msg.SaveAs "c:\temp\mail.eml", 1024

I get an error that states "Wrong OS or OS version". The OS is 64-bit, and Redemption installed as 64-bit, so I'm guessing the standalone MAPI library installed as 32-bit.

Does anyone know if I can get this to work with Redemption? If not, does anyone have other suggestions to convert these file types without having Outlook installed?

1

1 Answers

1
votes

Your app bitness must match the bitness of the MAPI system, there is no way around that. See http://www.dimastr.com/redemption/faq.htm#ErrorCreatingRedemptionObject for details.
You can either install the 64 bit version of Outlook (any version) or compile your app in 32 bit (x86).
Keep in mind that the standalone version of MAPI does not handle Unicode MSG files.