Last active
May 24, 2021 07:35
-
-
Save aspose-com-gists/da77886b7bd2f1aaaa30ab866efed541 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Load email message | |
eml = MailMessage.load("Message.eml") | |
# Convert email to MHTML | |
eml.save("SaveAsMhtml.mhtml", SaveOptions.default_mhtml) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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