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

(singke) #1

print("$status->unseen of $status->messages new
messages");
imap_close($mailbox);
?>


boolean imap_subscribe(integer stream, string mailbox)


Use imap_subscribe to subscribe to a mailbox.


<?


$mailbox = imap_open("{mail.server.com}INBOX", "leon",
"password");
imap_subscribe($mailbox, "PHP");
imap_close($mailbox);
?>


integer imap_uid(integer stream, integer message)


The imap_uid function returns the UID for the given message. To get the message
number based on UID, use imap_msgno.


boolean imap_undelete(integer stream, integer message)


The imap_undelete function removes the deletion mark on a message.


<?


// delete message number 3, then undelete
$mailbox = imap_open("{mail.server.com}INBOX",
"leon", "password");
imap_delete($mailbox, 3);
imap_undelete($mailbox, 3);
imap_close($mailbox);
?>


boolean imap_unsubscribe(integer stream, string mailbox)


Use imap_unsubscribe to unsubscribe to a mailbox.

Free download pdf