המרת הודעות אימייל ב-Ruby

Aspose.Email - המרת הודעות אימייל

להמרת הודעות אימייל באמצעות Aspose.Email Java for Ruby, יש לקרוא למתודה convert_eml_to_msg של מודול Converter. כאן ניתן לראות קוד לדוגמה.

קוד Ruby


 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

הורד קוד רץ

הורד את Converting Email Messages (Aspose.Email) מאתרי הקוד החברתי המופיעים למטה: