Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# 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