Email:Eml2Msg
lastmod 2020-12-10created 2020-12-043 edits
A C# program that converts the eml format to the msg format using the Aspose library.
Setup project
Create the project with dotnet:
Add the Aspose.Email package via Nuget.
After writing the code, build the program.
Run it.
Program.cs file
using Aspose.Email;
using System;
namespace tester
{
class Program
{
static void Main(string[] args)
{
EmlLoadOptions lo = new EmlLoadOptions();
lo.PreserveTnefAttachments = true;
MailMessage message = MailMessage.Load("test.eml", lo);
MsgSaveOptions so = new MsgSaveOptions(MailMessageSaveType.OutlookMessageFormatUnicode);
message.Save("test2.msg", so);
Console.WriteLine("Hello World!");
}
}
}