Skip to content

Instantly share code, notes, and snippets.

@aspose-com-gists
Last active February 16, 2021 01:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aspose-com-gists/3588603072eedc144ef45b28741db2df to your computer and use it in GitHub Desktop.
Save aspose-com-gists/3588603072eedc144ef45b28741db2df to your computer and use it in GitHub Desktop.
MSG or EML Emails to HTML or MHTML in C#
// Load email file
MailMessage mailMsg = MailMessage.Load("mail.eml");
// Convert email to HTML
mailMsg.Save("email-to-html.html", SaveOptions.DefaultHtml);
// Load email file
MailMessage mailMsg = MailMessage.Load("mail.msg");
// Convert email to MHTML
mailMsg.Save("email-to-html.html", SaveOptions.DefaultMhtml);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment