String Searching in PST with Ignore Case in Ruby

Aspose.Email - String Searching in PST with Ignore Case

To string Searching in PST with Ignore Case using Aspose.Email Java for Ruby, simply invoke StringSearchInPST module. Here you can see example code.

Ruby Code

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

\# Load the Outlook PST file

pst = Rjb::import('com.aspose.email.PersonalStorage').create(data_dir + "search.pst", Rjb::import('com.aspose.email.FileFormatVersion').Unicode)

fi = pst.createPredefinedFolder("Inbox", Rjb::import('com.aspose.email.StandardIpmFolder').Inbox)

fi.addMessage(Rjb::import('com.aspose.email.MapiMessage').fromMailMessage(Rjb::import('com.aspose.email.MailMessage').load(data_dir + "search.pst")))

builder = Rjb::import('com.aspose.email.MailQueryBuilder').new

builder.getFrom().contains("automated", true)

query = builder.getQuery()

coll = fi.getContents(query)

puts "Total Results:" + coll.size().to_s

Download Running Code

Download String Searching in PST with Ignore Case (Aspose.Email) from any of the below mentioned social coding sites: