This method supports unique IDs instead of message numbers. See
{@link ezcMailImapTransportOptions} for how to enable unique IDs
referencing.
See {@link http://www.faqs.org/rfcs/rfc1730.html} - 6.4.4. (or
{@link http://www.faqs.org/rfcs/rfc1730.html} - 6.4.4.) for criterias
which can be used for searching. The criterias can be combined in the
same search string (separate the criterias with spaces).
If $criteria is null or empty then it will default to 'ALL' (returns all
messages in the mailbox).
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.
Examples:
$imap = new ezcMailImapTransport( 'imap.example.com' );
$imap->authenticate( 'username', 'password' );
$imap->selectMailbox( 'mailbox' ); // Inbox or another mailbox
return an ezcMailImapSet containing all messages flagged as 'SEEN'
$set = $imap->searchMailbox( 'SEEN' );
return an ezcMailImapSet containing messages with 'release' in their Subject
$set = $imap->searchMailbox( 'SUBJECT "release"' );
criterias can be combined:
return an ezcMailImapSet containing messages flagged as 'SEEN' and
with 'release' in their Subject
$set = $imap->searchMailbox( 'SEEN SUBJECT "release"' );
$set can be parsed with ezcMailParser
public searchMailbox ( string $criteria = null ) : ezcMailImapSet | ||
$criteria | string | |
리턴 | ezcMailImapSet |