This method supports unique IDs instead of message numbers. See
{@link ezcMailImapTransportOptions} for how to enable unique IDs
referencing.
$messages is an array of message numbers, for example:
array( 1, 2, 4 );
$sortCriteria is an email header like: Subject, To, From, Date, Sender, etc.
Before calling this method, a connection to the IMAP server must be
established and a user must be authenticated successfully, and a mailbox
must be selected.
Example:
$imap = new ezcMailImapTransport( 'imap.example.com' );
$imap->authenticate( 'username', 'password' );
$imap->selectMailbox( 'mailbox' ); // Inbox or another mailbox
Fetch the list of messages sorted by Date
$set = $imap->sortMessages( 1, 10, "Date" );
$set can be parsed with ezcMailParser
public sortMessages ( array(int) $messages, string $sortCriteria, boolean $reverse = false ) : ezcMailImapSet | ||
$messages | array(int) | |
$sortCriteria | string | |
$reverse | boolean | |
return | ezcMailImapSet |