แปลงข้อความอีเมลใน Ruby

Aspose.Email - การแปลงข้อความอีเมล

เพื่อแปลงข้อความอีเมลโดยใช้ Aspose.Email Java for Ruby ให้เรียกเมธอด convert_eml_to_msg ของโมดูล Converter ที่นี่คุณจะเห็นโค้ดตัวอย่าง

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('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) จากไซต์โซเชียลโค้ดใดก็ได้ที่ระบุด้านล่าง: