Microsoft Word - Core PHP Programming Using PHP to Build Dynamic Web Sites

(singke) #1

UNFLAGGED


UNKEYWORD "string"
UNSEEN


<?


//get list of unread messages from Leon
$mailbox = imap_open("{mail.server.com:143}INBOX",
"leon", "password");
$msgs = imap_search($mailbox, "UNSEEN FROM
\"leon\"");
imap_close($mailbox);
?>


string imap_setflag_full(integer stream, string sequence, string
flag, string options)


The imap_setflag_full function sets a flag on a sequence of messages. The
options argument, if supplied, may be set to ST_UID, which signals that the
sequence argument contains UIDs instead of message numbers.


<?


$mailbox = imap_open("{mail.server.com:143}INBOX",
"leon", "password");
imap_setflag_full($mailbox, "12-15", "U", ST_UID);
imap_close($mailbox);
?>


array imap_sort(integer stream, integer criteria, integer
reverse, integer options)


Use the imap_sort function to get a sorted list of message numbers based on sort
criteria. The criteria argument must be one of the constants defined in Table


14.10. If the reverse argument is set to 1, the sort order will be reversed. The
options argument is a bitfield that may be set with SE_UID, specifying that UIDs are
used, or SE_NOPREFETCH, which will stop messages from being prefetched.


Table 14.10. Criteria Constants for imap_sort
Constant Description

SORTARRIVAL (^) Arrival date
SORTDATE (^) Message date

Free download pdf