Mail converter
Console application for converting e-mail files between EML(MIME) and MSG(Outlook) formats.
Mail converter is a sample command line application for converting email messages between MIME (*.eml) and Outlook MSG (*.msg) formats.
Usage is simple:
Syntax: MailConverter.exe -tomime|-tomsg sourcepath targetpath Example: MailConverter.exe -tomsg C:\mail.eml C:\mail.msg Example: MailConverter.exe -tomime C:\mail.msg C:\mail.eml
Following code demonstrates how it's done:
C#
// load a mail MailMessage mail = new MailMessage(); mail.Load(path); // save as MIME mail.Save(filename + ".eml", MailFormat.Mime); // save as Outlook MSG mail.Save(filename + ".msg", MailFormat.OutlookMsg);
VB.NET
' load a mail Dim mail As MailMessage = New MailMessage() mail.Load(path) ' save as MIME mail.Save(filename + ".eml", MailFormat.Mime) ' save as Outlook MSG mail.Save(filename + ".msg", MailFormat.OutlookMsg)
This sample is also available as a stand alone application at labs.rebex.net/MailConverter.