Aspose.EMAIL  for .NET

Aspose.EMAIL for .NET

Convert MSG to MHT via C#

Convert MSG to MHT without needing Microsoft® Outlook® or Thunderbird® installed.

How to Convert MSG to MHT Using C#

In order to convert MSG to MHT, we’ll use Aspose.Email for .NET API which is a feature-rich, powerful and easy to use document manipulation and conversion API for C# platform. Open NuGet package manager, search for Aspose.Email and install. You may also use the following command from the Package Manager Console.


PM> Install-Package Aspose.EMAIL

Steps to Convert MSG to MHT via C#

Aspose.EMAIL makes it easy for the developers to load & convert MSG files to MHT in just a few lines of code.

  1. Load MSG file with Aspose.Email.MailMessage.Load.
  2. Call the Save method.
  3. Pass the output file path with MHT file extension.
  4. MHT file will be saved at the specified path.

System Requirements

Aspose.EMAIL for .NET is supported on all major operating systems. Just make sure that you have the following prerequisites.

  • Microsoft Windows or a compatible OS with .NET Framework, .NET Core, and PHP, VBScript, Delphi, C++ via COM Interop.
  • Development environment like Microsoft Visual Studio.
  • Aspose.EMAIL for .NET DLL referenced in your project.


// load the MSG file to be converted
var message = Aspose.Email.MailMessage.Load("My File.msg"); 
// save MSG as a MHT 
message.Save("Saved File.mht", Aspose.Email.SaveOptions.DefaultMht); 


    Free App to Convert MSG to MHT

    Check our live demos for MSG to MHT conversion with following benefits.

      No need to download or setup anything.
      No need to write any code.
      Just upload your MSG file and hit the "Convert" button.
      You will instantly get the download link for resultant MHT file.

    An Emailing Library that makes it easier to work with a number of Microsoft Outlook & Mozilla Thunderbird formats as well as provides the ability to manage message storage files. The API also allows to send & receive emails via POP3, IMAP & SMTP or connect with Microsoft Exchange Server via WebDav & Exchange Web Services.

    MSG What is MSG File Format

    MSG is a file format used by Microsoft Outlook and Exchange to store email messages, contact, appointment, or other tasks. Such messages may contain one or more email fields, with the sender, recipient, subject, date, and message body, or contact information, appointment particulars, and one or more task specifications. The properties that constitute the Message object, including are also a part of the MSG file. MSG file has headers, main message body, and hyperlinks as plain ASCII text. MSG files are also suitable with the programs that need Microsoft's Messaging Applications Programming Interface (MAPI).

    Read More

    mht What is mht File Format

    A file with .mht extension is a MIME enabled archiving file format that contains different types of data into a single file. It can store data such as text, images, page styling in the form of CSS files, JavaScript, and other resources as embedded resources in it. MHT files, having MIME type message/rfc822, encapsulate all the contents of an HTML file as a single archive file for storing on archiving on storage devices. Software applications such as Microsoft Word lets you convert your WORD documents to MHT by exporting as MHT file. MHT files can be opened using popular browsers such as Microsoft Internet Explore and Google Chrome.

    Read More

    Other Supported Conversions

    You can also convert MSG into many other file formats including few listed below.

    MSG TO EML (Outlook Email Messages)
    MSG TO EMLX (Apple EMLX Format)
    MSG TO HTML (Hyper Text Markup Language)
    MSG TO ICS (iCalendar)
    MSG TO MBOX (Electronic Mail Messages)
    MSG TO MHTML (Web Page Archive Format)
    MSG TO OFT (Outlook Email Templates)
    MSG TO OST (Offline Storage Files)
    MSG TO PST (Outlook Personal Storage Files)
    MSG TO VCF (Virtual Card Format)