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

(singke) #1

You may use imap_rename as an alias for imap_renamemailbox.


boolean imap_renamemailbox(integer stream, string
old_name, string new_name)


The imap_renamemailbox function changes the name of a mailbox.


<?


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


boolean imap_reopen(integer stream, string username, string
password, integer flags)


Use imap_reopen to open a connection that has died. Operation is identical to
imap_open.


<?


$mailbox = imap_open("{mail.server.com}INBOX",
"leon", "password");


// if connection is dead, reopen
if(!imap_ping($mailbox))
{
imap_reopen($mailbox, "leon", "password");
}


imap_close($mailbox);
?>


array imap_rfc822_parse_adrlist(string address, string host)


The imap_rfc_parse_adrlist function parses an email address given a default
host and returns an array of objects. Each object has the following properties: mailbox,
host, personal, adl. The mailbox property is the name before the @. The host
property is the destination machine or domain. The personal property is the name of

Free download pdf