String Searching in PST with Ignore Case in Python

Aspose.Email - String Searching in PST with Ignore Case

String Searching in PST with Ignore Case using Aspose.Email Java for Python, Use following code.

Python Code




personalStorage = self.PersonalStorage

fileFormatVersion = self.FileFormatVersion

pst = personalStorage.create(self.dataDir + "search.pst", fileFormatVersion.Unicode)

standardIpmFolder = self.StandardIpmFolder

fi = pst.createPredefinedFolder("Inbox", standardIpmFolder.Inbox)

mapiMessage = self.MapiMessage

mailMessage = self.MailMessage

fi.addMessage(mapiMessage.fromMailMessage(mailMessage.load(self.dataDir + "search.pst")))

builder = self.MailQueryBuilder()

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

query = builder.getQuery()

coll = fi.getContents(query)

print "Total Results:"

print coll.size()

Download Running Code

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