__construct()
__destruct()
append()
capability()
connect()
copy()
create()
delete()
escapeList()
escapeString()
examine()
examineOrSelect()
expunge()
fetch()
listMailbox()
login()
logout()
noop()
readLine()
readResponse()
rename()
requestAndResponse()
search()
select()
sendRequest()
store()
_assumedNextLine()
_decodeLine()
_nextLine()
_nextTaggedLine()
$socket
$tagCount
TIMEOUT_CONNECTION
__construct(string $host, int | null $port, bool $ssl)
stringhostname or IP address of IMAP server, if given connect() is called
intnullport of IMAP server, null for default (143 or 993 for ssl)
booluse ssl? 'SSL', 'TLS' or false
\Zend\Mail\Protocol\Exception\ExceptionInterface |
|---|
__destruct()
append(string $folder, string $message, array $flags, string $date) : bool
stringname of target folder
stringfull message content
arrayflags for new message
stringdate for new message
\Zend\Mail\Protocol\Exception\ExceptionInterface |
|---|
boolsuccesscapability() : array
connect(string $host, int | null $port, string | bool $ssl) : string
stringhostname or IP address of IMAP server
intnullof IMAP server, default is 143 (993 for ssl)
stringbooluse 'SSL', 'TLS' or false
\Zend\Mail\Protocol\Exception\RuntimeException |
|---|
stringwelcome messagecopy(string $folder, $from, int | null $to) : bool
stringdestination folder
intnullif null only one message ($from) is fetched, else it's the last message, INF means last message available
boolsuccesscreate(string $folder) : bool
stringfolder name
boolsuccessdelete(string $folder) : bool
stringfolder name
boolsuccessescapeList(array $list) : string
arraylist with literals or lists as PHP array
stringescaped list for imapescapeString(string | array $string) : string | array
for sendRequest
stringarraythe literal/-s
stringarrayescape literals, literals with newline ar returned as array('{size}', 'string');examine(string $box) : bool | array
stringexamine this folder
\Zend\Mail\Protocol\Exception\ExceptionInterface |
|---|
boolarraysee examineOrselect()examineOrSelect(string $command, string $box) : bool | array
The common code for both is in this method
stringcan be 'EXAMINE' or 'SELECT' and this is used as command
stringwhich folder to change to or examine
\Zend\Mail\Protocol\Exception\ExceptionInterface |
|---|
boolarrayfalse if error, array with returned information otherwise (flags, exists, recent, uidvalidity)expunge() : bool
boolsuccessfetch(string | array $items, int | array $from, int | null $to) : string | array
stringarrayitems to fetch from message(s) as string (if only one item) or array of strings
intarraymessage for items or start message if $to !== null
intnullif null only one message ($from) is fetched, else it's the last message, INF means last message available
\Zend\Mail\Protocol\Exception\RuntimeException |
|---|
stringarrayif only one item of one message is fetched it's returned as string if items of one message are fetched it's returned as (name => value) if one items of messages are fetched it's returned as (msgno => value) if items of messages are fetched it's returned as (msgno => (name => value))listMailbox(string $reference, string $mailbox) : array
this method can't be named after the IMAP command 'LIST', as list is a reserved keyword
stringmailbox reference for list
stringmailbox name match with wildcards
\Zend\Mail\Protocol\Exception\ExceptionInterface |
|---|
arraymailboxes that matched $mailbox as array(globalName => array('delim' => .., 'flags' => ..))login(string $user, string $password) : bool
stringusername
stringpassword
boolsuccesslogout() : bool
boolsuccessnoop() : bool
boolsuccessreadLine(array | string $tokens, string $wantedTag, bool $dontParse) : bool
.}
arraystringdecoded tokens are returned by reference, if $dontParse is true the unparsed line is returned here
stringcheck for this tag for response code. Default '*' is continuation tag.
boolif true only the unparsed line is returned $tokens
boolif returned tag matches wanted tagreadResponse(string $tag, bool $dontParse) : null | bool | array
stringthe tag of your request
boolif true every line is returned unparsed instead of the decoded tokens
nullboolarraytokens if success, false if error, null if bad requestrename(string $old, string $new) : bool
stringold name
stringnew name
boolsuccessrequestAndResponse(string $command, array $tokens, bool $dontParse) : mixed
stringcommand as in sendRequest()
arrayparameters as in sendRequest()
boolif true unparsed lines are returned instead of tokens
mixedresponse as in readResponse()search(array $params) : array
This method is currently marked as internal as the API might change and is not safe if you don't take precautions.
array
arraymessage idsselect(string $box) : bool | array
stringchange to this folder
\Zend\Mail\Protocol\Exception\ExceptionInterface |
|---|
boolarraysee examineOrselect()sendRequest(string $command, array $tokens, string $tag)
stringyour request command
arrayadditional parameters to command, use escapeString() to prepare
stringprovide a tag otherwise an autogenerated is returned
\Zend\Mail\Protocol\Exception\RuntimeException |
|---|
store(array $flags, int $from, int | null $to, string | null $mode, bool $silent) : bool | array
arrayflags to set, add or remove - see $mode
intmessage for items or start message if $to !== null
intnullif null only one message ($from) is fetched, else it's the last message, INF means last message available
stringnull'+' to add flags, '-' to remove flags, everything else sets the flags as given
boolif false the return values are the new flags for the wanted messages
\Zend\Mail\Protocol\Exception\ExceptionInterface |
|---|
boolarraynew flags if $silent is false, else true or false depending on success_assumedNextLine(string $start) : bool
some requests give a simple feedback so we can quickly check if we can go on.
stringthe first bytes we assume to be in the next line
boolline starts with $start_decodeLine(string $line) : array
a token is literal of any form or a list
stringline to decode
arraytokens, literals are returned as string, lists as array_nextLine() : string
_nextTaggedLine(string $tag) : string
that's the normal case for a response line
stringtag of line is returned by reference
stringnext line$socket : resource | null
$tagCount : int
TIMEOUT_CONNECTION