A file with the EMLX or EML file extension is a Mail Message file used to store an email message. EML/EMLX file can converted to MHTML or MSG file format with few lines of core code by using Spire.Email.
Convert EML/EMLX to MHTML
[C#]
using Spire.Email; using System; namespace ConvertEMLandEMLXtoMHTML { class Program { static void Main(string[] args) { MailMessage message = MailMessage.Load("example.eml"); message.Save("ToMhtml.mhtml", MailMessageFormat.Mhtml); Console.WriteLine("Done"); } } }
[VB.NET]
Imports Spire.Email Namespace ConvertEMLandEMLXtoMHTML Class Program Private Shared Sub Main(args As String()) Dim message As MailMessage = MailMessage.Load("example.eml") message.Save("ToMhtml.mhtml", MailMessageFormat.Mhtml) Console.WriteLine("Done") End Sub End Class End Namespace
Convert EML/EMLX to MSG
[C#]
using Spire.Email; using System; namespace ConvertEMLandEMLXtoMSG { class Program { static void Main(string[] args) { MailMessage message = MailMessage.Load("example.eml"); message.Save("ToMsg.msg", MailMessageFormat.Msg); Console.WriteLine("Done"); } } }
[VB.NET]
Imports Spire.Email Namespace ConvertEMLandEMLXtoMSG Class Program Private Shared Sub Main(args As String()) Dim message As MailMessage = MailMessage.Load("example.eml") message.Save("ToMsg.msg", MailMessageFormat.Msg) Console.WriteLine("Done") End Sub End Class End Namespace