• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 16. PHP > IMAP Functions

16.21. 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 map. That requires the C-client library to be installed. You can get the latest version from ftp://ftp.cac.washington.edu/imap/ and compile it.


string imap_8bit(string text)

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


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 base-64-encoded text


string imap_binary(string text)

Convert an 8-bit string to a base-64-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


int imap_expunge(int stream_id)

Delete all messages marked for deletion


array imap_fetch_overview(int stream_id, int msg_no)

Read an overview of the information in the headers of the given message


string imap_fetchbody(int stream_id, int msg_no, int section [, int options])

Get a specific body section


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

Get the full, unfiltered header for a message


object imap_fetchstructure(int stream_id, int msg_no [, int options])

Read the full structure of a message


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

An alias for imap_body


object imap_header(int stream_id, int msg_no [, int from_length [, int subject_length [, string default_host]]])

Read the header of the message


object imap_headerinfo(int stream_id, int msg_no [, int from_length [, int subject_length [, string default_host]]])

An alias for imap_header


array imap_headers(int stream_id)

Return headers for all messages in a mailbox


array imap_list(int stream_id, string ref, string pattern)

Read the list of mailboxes


array imap_listmailbox(int stream_id, string ref, string pattern)

An alias for imap_list


array imap_listsubscribed(int stream_id, string ref, string pattern)

An alias for imap_lsub


array imap_lsub(int stream_id, string ref, string pattern)

Return a list of subscribed mailboxes


string imap_mail_compose(array envelope, array body)

Create a MIME message based on given envelope and body sections


int imap_mail_copy(int stream_id, int msg_no, string mailbox [, int options])

Copy specified message to a mailbox


bool imap_mail_move(int stream_id, int msg_no, string mailbox)

Move specified message to a mailbox


array imap_mailboxmsginfo(int stream_id)

Return information about the current mailbox in an associative array


int imap_msgno(int stream_id, int unique_msg_id)

Get the sequence number associated with a user ID


int imap_num_msg(int stream_id)

Give the number of messages in the current mailbox


int imap_num_recent(int stream_id)

Give the number of recent messages in the current mailbox


int imap_open(string mailbox, string user, string password [, int options])

Open an IMAP stream to a mailbox


int imap_ping(int stream_id)

Check if the IMAP stream is still active


string imap_qprint(string text)

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


int imap_rename(int stream_id, string old_name, string new_name)

An alias for imap_renamemailbox


int imap_renamemailbox(int stream_id, string old_name, string new_name)

Rename a mailbox


int imap_reopen(int stream_id, string mailbox [, int options])

Reopen IMAP stream to new mailbox


array imap_rfc822_parse_adrlist(string address_string, string default_host)

Parse an address string


string imap_rfc822_write_address(string mailbox, string host, string personal)

Return a properly formatted email address given the mailbox, host, and personal info


array imap_scan(int stream_id, string ref, string pattern, string content)

Read list of mailboxes containing a certain string


array imap_scanmailbox(int stream_id, string ref, string pattern, string content)

An alias for imap_scan


int imap_setflag_full(int stream_id, string sequence, string flag [, int options])

Sets flags on messages


array imap_sort(int stream_id, int criteria, int reverse [, int options])

Sort an array of message headers


object imap_status(int stream_id, string mailbox, int options)

Get status info from a mailbox


int imap_subscribe(int stream_id, string mailbox)

Subscribe to a mailbox


int imap_uid(int stream_id, int msg_no)

Get the unique message ID associated with a standard sequential message number


int imap_undelete(int stream_id, int msg_no)

Remove the delete flag from a message


int imap_unsubscribe(int stream_id, string mailbox)

Unsubscribe from a mailbox


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint