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

(singke) #1

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


imap_fetchtext


You may use imap_fetchtext as an alias for imap_body.


array imap_getmailboxes(integer stream, string reference,
string pattern)


The imap_getmailboxes function returns detailed information about mailboxes in
the form of an array of objects. The reference argument is an IMAP server in the
normal form: "{server:port}". The pattern argument controls which mailboxes are
returned. An asterisk (*) matches all mailboxes, and a percentage symbol (%) matches all
mailboxes at a particular level.


The returned objects contain three properties: name, delimiter, and attributes, a
bitfield that may be tested against the constants listed in Table 14.5.


<?


$mailbox = imap_open("{mail.server.com}INBOX",
"leon", "password");
$boxes = imap_getmailboxes($mailbox,
"{mail.server.com:25}", "*");
imap_close($mailbox);


for(list($box) = each($boxes))
{
print("$box->name
\n");
}
?>


array imap_getsubscribed(integer stream, string reference,
string pattern)


This function returns subscribed mailboxes. The reference and pattern arguments
are optional.

Free download pdf