SORTFROM (^) First mailbox in from: line
SORTSIZE (^) Size of message
SORTSUBJECT (^) Message subject
SORTCC (^) First mailbox in cc: line
SORTO (^) First mailbox in to: line
<?
$mailbox = imap_open("{mail.server.com:143}",
"leon", "password");
$list = imap_sort($mailbox, SORTFROM, 0,
SE_NOPREFETCH);
while(list($msg_num) = each($list))
{
print("$msg_num ");
}
imap_close($mailbox);
?>
object imap_status(integer stream, string mailbox, integer
options)
The imap_status function returns an object with properties describing the status of a
mailbox. The only property guaranteed to exist is flags, which tells you which other
properties exist. You choose the properties to generate with the options argument.
Constants to use for options are listed in Table 14.11.
Table 14.11. imap_status Options
Constant Description
SA_ALL (^) Turns on all properties
SA_MESSAGES (^) Number of messages in mailbox
SA_RECENT (^) Number of recent messages
SA_QUOTA (^) Disk space used by mailbox
SA_QUOTA_ALL (^) Disk space used by all mailboxes
SA_UIDNEXT (^) Next UID to be used
SA_UIDVALIDITY (^) Flag for the validity of UID data
SA_UNSEEN (^) Number of new messages
<?
$mailbox = imap_open("{mail.server.com}INBOX",
"leon", "password");
$status = imap_status($mailbox, "INBOX",
SA_UNSEEN | SA_MESSAGES);