A transaction name for this step in quotes. To avoid creating a transaction for this step, use a null string, "".

mode

The fetch mode in the following format:"Mode=mode"

message

The messages whose data you want to fetch and the data. The data can be any information associated with the message, such as UID, FLAGS, RFC822.SIZE, RFC822.HEADER, etc. "Fetch=begin_msg:end_msg (data)"

saveto

The name of the parameter to save message to."saveto=ParameterName"

ENDITEM

A marker indicating the end of the data item list. Repeat the option and ENDITEM arguments for each set of data that you fetch.

LAST

A marker indicating the end of the argument list.

The imap_fetch_ex function retrieves data associated with mailbox messages, for a specific session. You can request the value of any message data including flags, headers, and message IDs.

This function is for use with multiple sessions. For global sessions, use the imap_fetch function, which leaves out the session identifier.