Converting Email Messages in Jython

Aspose.Email - Converting Email Messages

To Convert Email Messages using Aspose.Email Java for Jython, call convert_eml_to_msg method of Converter module. Here you can see example code.

Jython Code

 from aspose-email import Settings

from import MailMessage

from import SaveOptions

class Converter:

    def __init__(self):

        # Loading EML, Saving to MSG


    def convert_eml_to_msg(dataDir):

        dataDir = Settings.dataDir + 'ProgrammingEmail/Converter/'

        # Initialize and Load an existing EML file by specifying the MessageFormat

        mailMessage = MailMessage()

        eml = mailMessage.load(dataDir + "Message.eml")

        # Save the Email message to disk in Unicode format

        saveOptions= SaveOptions + "AnEmail.msg", saveOptions.getDefaultMsgUnicode())

        # Display Status

        print "Converted email to msg successfully."

if __name__ == '__main__':        


Download Running Code

Download Converting Email Messages (Aspose.Email) from any of the below mentioned social coding sites: