Convert Email Files between MSG, EML and MHT in C# and VB.NET

The GemBox.Email library supports reading and writing email messages of the following file formats:

  • MSG (Outlook Item)
  • EML (Electronic Mail Format)

You can load an email file from one format and save it as another format, thus achieving a straightforward conversion of emails from your C# and VB.NET code.

Both the loaded input file and saved output file can be obtained as physical files (when providing a file's path) or as in-memory files (when providing a file's stream).

The following example shows how you can convert an email by reading an input file, representing it with a MailMessage object, and saving it to the output file of the desired format.

Converted email between MSG, EML, and MHTML formats in C# and VB.NET
Screenshot of converted email files
Upload your file (Drag file here)
using GemBox.Email;

class Program
    static void Main()
        // If using Professional version, put your serial key below.

        // Convert email from one format into another.
        MailMessage message = MailMessage.Load("%InputFileName%");
Imports GemBox.Email

Module Program

    Sub Main()

        ' If using Professional version, put your serial key below.

        ' Convert email from one format into another.
        Dim message As MailMessage = MailMessage.Load("%InputFileName%")

    End Sub
End Module

Want more?

Next example GitHub

Check the next example or select an example from the menu. You can also download our examples from the GitHub.

Like it?

Download Buy

If you want to try the GemBox.Email yourself, you can download the free version. It delivers the same performance and set of features as the professional version, but with some operations limited. To remove the limitation, you need to purchase a license.