Post: Convert Email Messages to Other Formats and Manage Attachments in Cloud Using Ruby
06-06-2014, 06:05 AM #1
(adsbygoogle = window.adsbygoogle || []).push({}); You can convert Email Message to other formats like EML, MSG & MHT using You must login or register to view this content.. Also, developers can download attachments from email messages and store them on a local disc or on Aspose storage. It is even possible to modify email message properties like From, To, and Subject. Below are the code samples for Converting Email to Other Formats and Download Attachment from Email.

Converting Email to Other Formats

    require 'path/to/lib/asposecloudsdk'
app_sid = '****'
app_key = '****'
Aspose::Cloud::Common::AsposeApp.app_key = app_key
Aspose::Cloud::Common::AsposeApp.app_sid = app_sid
Aspose::Cloud::Common::AsposeApp.output_location = ''
Aspose::Cloud::Common::Product.set_base_product_uri('https://api.aspose.com/v1.1')
# Create Object of folder class
folder = Aspose::Cloud::AsposeStorage::Folder.new
folder.upload_file 'path/to/storage/email_test.eml'
# Create object of converter
con_obj = Aspose::Cloud::Email::Converter.new('path/to/storage/email_test.eml'Winky Winky
con_obj.convert('msg'Winky Winky


Download Attachment from Email

    require 'path/to/lib/asposecloudsdk'
app_sid = '****'
app_key = '****'
Aspose::Cloud::Common::AsposeApp.app_key = app_key
Aspose::Cloud::Common::AsposeApp.app_sid = app_sid
Aspose::Cloud::Common::AsposeApp.output_location = ''
Aspose::Cloud::Common::Product.set_base_product_uri('https://api.aspose.com/v1.1')
# Create Object of folder class
folder = Aspose::Cloud::AsposeStorage::Folder.new
folder.upload_file 'path/to/storage/email_test.eml'
# Create object of email document
doc_obj = Aspose::Cloud::Email:Happyocument.new('path/to/storage/email_test.eml'Winky Winky
result = doc_obj.get_attachment('attachment.jpg'Winky Winky

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo