Chuyển đổi Tin nhắn Email trong Ruby
Contents
[
Hide
]
Aspose.Email - Chuyển đổi tin nhắn email
Để Chuyển đổi tin nhắn email bằng Aspose.Email Java cho Ruby, gọi phương thức convert_eml_to_msg của mô-đun Converter. Dưới đây là ví dụ mã.
Mã 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
Tải mã đang chạy
Tải Chuyển đổi tin nhắn email (Aspose.Email) từ bất kỳ một trong các trang mã nguồn xã hội được đề cập dưới đây: