authenticate( "user", "password" ); // Select the Inbox mailbox $imap->selectMailbox( 'Inbox' ); // List the capabilities of the IMAP server $capabilities = $imap->capability(); // List existing mailboxes $mailboxes = $imap->listMailboxes( "", "*" ); // Create a new mailbox $imap->createMailbox( "Reports 2006" ); // Delete a mailbox $imap->deleteMailbox( "Reports 2005" ); // Rename a mailbox $imap->renameMailbox( "Reports 2006", "Reports" ); // Copy messages from the selected mailbox (here: Inbox) to another mailbox $imap->copyMessages( "1,2,4", "Reports" ); // Set a flag to messages // See the function description for a list of supported flags $imap->setFlag( "1,2,4", "DELETED" ); // Clears a flag from messages // See the function description for a list of supported flags $imap->setFlag( "1,2,4", "SEEN" ); // Append a message to a mailbox. $mail must contain the mail as text // Use this with a "Sent" or "Drafts" mailbox $imap->append( "Sent", $mail ); // Create a new mail parser object $parser = new ezcMailParser(); // Parse the set of messages retrieved from the server earlier $mail = $parser->parseMail( $set ); ?>