在 Ruby 中转换电子邮件

Aspose.Email - 转换电子邮件消息

要使用 Aspose.Email Java for Ruby 转换电子邮件消息,调用 Converter 模块的 convert_eml_to_msg 方法。以下是示例代码。

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

下载运行代码

从以下任意提到的社交编码站点下载 转换电子邮件消息 (Aspose.Email)