O'Reilly logo

PHP Pocket Reference by Rasmus Lerdorf

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

IMAP Functions

These functions are used to communicate with mail and news servers via the IMAP4, POP3, or NNTP protocols. For these functions to work, you have to compile PHP with - - with-imap. That requires the C-client library to be installed. You can get the latest version from ftp://ftp.cac.washington.edu/imap/.

Here are the IMAP functions:

string imap_8bit(string text)

Convert an 8-bit string to a quoted-printable string

string imap_alerts(void)

Return an array of all IMAP alerts

int imap_append(int stream_id, string folder, string message [, string flags])

Append a string message to a specified mailbox

string imap_base64(string text)

Decode base64-encoded text

string imap_binary(string text)

Convert an 8-bit string to a base64-encoded string

string imap_body(int stream_id, int msg_no [, int options])

Read the message body

object imap_bodystruct(int stream_id, int msg_no, int section)

Read the structure of a specified body section of a specific message

object imap_check(int stream_id)

Get mailbox properties

void imap_clearflag_full(int stream_id, string sequence, string flag [, int options])

Clear flags on messages

int imap_close(int stream_id [, int options])

Close an IMAP stream

int imap_create(int stream_id, string mailbox)

An alias for imap_createmailbox( )

int imap_createmailbox(int stream_id, string mailbox)

Create a new mailbox

int imap_delete(int stream_id, int msg_no)

Mark a message for deletion

bool imap_deletemailbox(int stream_id, string mailbox)

Delete a mailbox

string imap_errors(void) ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required