All mail retrieval classes offer a method to retrieve mail objects by specifying an instance of RetrievalConstraints. Retrieval will then evaluate the provided constraints and return only those messages that match. Only provided attributes will be evaluated, so you can provide a value for e.g. fromTimestamp and leave all remaining attributes empty, resulting in retrieval of all messages received after fromTimestamp.

Figure: The RetrievalConstraints Class

Class RetrievalConstraints has the following attributes:

Attribute NameDescriptionAllowed Values 
fromTimestamponly emails received after the given DateTime will be retrievedany valid DateTime object 
toTimestamponly emails received before the given DateTime will be retrievedany valid DateTime object
subjectSubstringonly emails whose subject line contains the given String will be retrievedany String
unreadOnlyonly emails flagged as unread on the server will be retrievedtrue/false (default false)
maxResultCountlimits the size of resulting array of retrieved objects to the given valueany positive Integer (default unlimited)
specificFolderonly emails from the specified folder will be retrievedany valid folder name (default "INBOX")
deleteOnServerspecifies whether retrieved objects shall be immediately deleted on the servertrue/false (default false)
  • No labels