Skip to content

Instantly share code, notes, and snippets.

@aspose-com-gists
Last active May 24, 2021 07:35
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/da77886b7bd2f1aaaa30ab866efed541 to your computer and use it in GitHub Desktop.
Save aspose-com-gists/da77886b7bd2f1aaaa30ab866efed541 to your computer and use it in GitHub Desktop.
# Load email message
eml = MailMessage.load("Message.eml")
# Convert email to MHTML
eml.save("SaveAsMhtml.mhtml", SaveOptions.default_mhtml)
import aspose.email as ae
from aspose.email import MailMessage, SaveOptions, HtmlFormatOptions
# Load EML message
eml = MailMessage.load("Message.eml")
# Set SaveOptions
options = SaveOptions.default_html
options.embed_resources = False
options.HtmlFormatOptions = HtmlFormatOptions.WriteHeader | HtmlFormatOptions.WriteCompleteEmailAddress #save the message headers to output HTML using the formatting options
# Convert EML to HTML
eml.save("SaveAsHTML.html", options)
import aspose.email as ae
from aspose.email import MailMessage, SaveOptions, HtmlFormatOptions
# Load EML message
msg = MailMessage.load("Message.msg")
# Set SaveOptions
options = SaveOptions.default_html
options.embed_resources = False
options.HtmlFormatOptions = HtmlFormatOptions.WriteHeader | HtmlFormatOptions.WriteCompleteEmailAddress #save the message headers to output HTML using the formatting options
# Convert msg to HTML
msg.save("SaveAsHTML.html", options)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment