Adding Files to PST in Ruby

Aspose.Email - Adding Files to PST

To Add File to PST using Aspose.Email Java for Ruby, simply invoke AddFileToPST module. Here you can see example code.

Ruby Code

 data_dir = File.dirname(File.dirname(File.dirname(File.dirname(__FILE__)))) + '/data/'

pst = Rjb::import('').create(data_dir + "AddFile.pst", Rjb::import('').Unicode)

fi = pst.createPredefinedFolder("Inbox", Rjb::import('').Inbox)

fi.addFile(data_dir + "Report.xlsx", "IPM.Document.Excel.Sheet.8")


puts "Added file to PST"

Download Running Code

Download Adding Files to PST (Aspose.Email) from any of the below mentioned social coding sites: