Module: Asposeemailjava::Converter

Defined in:
lib/asposeemailjava/Email/converter.rb

Instance Method Summary collapse

Instance Method Details

#convert_eml_to_msgObject



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/asposeemailjava/Email/converter.rb', line 8

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('com.aspose.email.MailMessage').load(data_dir + "Message.eml")

    # Save the Email message to disk in Unicode format
    eml.save(data_dir + "AnEmail.msg", Rjb::import('com.aspose.email.SaveOptions').getDefaultMsgUnicode())

    # Display Status
    puts "Converted eml to msg successfully."
end

#initializeObject



3
4
5
6
# File 'lib/asposeemailjava/Email/converter.rb', line 3

def initialize()
    # Loading EML, Saving to MSG 
    convert_eml_to_msg()
end