Mail Retrieval Constraints
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 Name | Description | Allowed Values | |
---|---|---|---|
fromTimestamp | only emails received after the given DateTime will be retrieved | any valid DateTime object | |
toTimestamp | only emails received before the given DateTime will be retrieved | any valid DateTime object | |
subjectSubstring | only emails whose subject line contains the given String will be retrieved | any String | |
unreadOnly | only emails flagged as unread on the server will be retrieved | true/false (default false) | |
maxResultCount | limits the size of resulting array of retrieved objects to the given value | any positive Integer (default unlimited) | |
specificFolder | only emails from the specified folder will be retrieved | any valid folder name (default "INBOX") | |
deleteOnServer | specifies whether retrieved objects shall be immediately deleted on the server | true/false (default false) |