public static void Run()
{
// ExStart:CreatEMLFileAndConvertToMSG
// The path to the File directory.
string dataDir = RunExamples.GetDataDir_Outlook();
// Create new message and save as EML
MailMessage message = new MailMessage("[email protected]", "[email protected]");
message.Subject = "subject of email";
message.HtmlBody = "<b>Eml to msg conversion using Aspose.Email</b>" +
"<br><hr><br><font color=blue>This is a test eml file which will be converted to msg format.</font>";
// Add attachments
message.Attachments.Add(new Attachment(dataDir + "attachment_1.doc"));
message.Attachments.Add(new Attachment(dataDir + "download.png"));
// Save it EML
message.Save(dataDir + "CreatEMLFileAndConvertToMSG_out.eml", SaveOptions.DefaultEml);
// Save it to MSG
message.Save(dataDir + "CreatEMLFileAndConvertToMSG_out.msg", SaveOptions.DefaultMsgUnicode);
// ExEnd:CreatEMLFileAndConvertToMSG
}
}