SortCriteria Property

Sorts criteria to use for message retrieval operations.

Object Oriented Interface

public function getSortCriteria();
public function setSortCriteria($value);

Procedural Interface

cloudmail_gmail_get($res, 81 );
cloudmail_gmail_set($res, 81, $value );

Default Value



This property sorts criteria to use for message retrieval operations. When set, the class will send the SORT command to the server before any retrieval. If the server supports the SORT command, the results from the fetch operation will be sorted according to SortCriteria. The format of the SortCriteria property consists of a parenthesized list of one or more sort keys.

Example (Setting SortCriteria)

IMAPControl.SortCriteria = "DATE"

IMAPControl.SortCriteria = "SUBJECT FROM"

IMAPControl.SortCriteria = "REVERSE SUBJECT"

Possible sort keys include:

ARRIVALInternal date and time of the message.
DATEThe value of the message's DATE header, adjusted by time zone
CC The value of the message's CC header.
FROM The value of the message's FROM header.
SUBJECT The value of the message's SUBJECT header.
TO The value of the message's TO header.
SIZEThe size of the message
REVERSE <criterion>Followed by another sort criterion, has the effect of that criterion but in reverse (descending) order

Please note that IMAP SORT functionality is relatively new and not all servers may implement it.

Data Type


Copyright (c) 2021 /n software inc. - All rights reserved.
Cloud Mail 2020 PHP Edition - Version 20.0 [Build 7718]