Converting Email Messages in Ruby

Aspose.Email - Converting Email Messages

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

Ruby Code

 def convert_eml_to_msg()    

    data_dir = File.dirname(File.dirname(File.dirname(File.dirname(__FILE__)))) + '/data/'

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

    eml = Rjb::import('').load(data_dir + "Message.eml")

    # Save the Email message to disk in Unicode format + "AnEmail.msg", Rjb::import('').getDefaultMsgUnicode())

    # Display Status

    puts "Converted eml to msg successfully."


Download Running Code

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