Public constructor
Zend_Mail_Protocol_Imap
__construct
([string $host = ''], [int|null $port = null], [bool $ssl = false])
-
string
$host: hostname of IP address of IMAP server, if given connect() is called
-
int|null
$port: port of IMAP server, null for default (143 or 993 for ssl)
-
bool
$ssl: use ssl? 'SSL', 'TLS' or false
Public destructor
void
__destruct
()
Get capabilities from IMAP server
array
capability
()
Open connection to POP3 server
string
connect
(string $host, [int|null $port = null], [string|bool $ssl = false])
-
string
$host: hostname of IP address of POP3 server
-
int|null
$port: of IMAP server, default is 143 (993 for ssl)
-
string|bool
$ssl: use 'SSL', 'TLS' or false
escape a list with literals or lists
string
escapeList
(array $list)
-
array
$list: list with literals or lists as PHP array
escape one or more literals i.e. for sendRequest
string|array
escapeString
(string|array $string)
-
string|array
$string: the literal/-s
examine folder
bool|array
examine
([string $box = 'INBOX'])
-
string
$box: examine this folder
Examine and select have the same response. The common code for both is in this method
bool|array
examineOrSelect
([string $command = 'EXAMINE'], [string $box = 'INBOX'])
-
string
$command: can be 'EXAMINE' or 'SELECT' and this is used as command
-
string
$box: which folder to change to or examine
fetch one or more items of one or more messages
string|array
fetch
(string|array $items, int $from, [int|null $to = null])
-
string|array
$items: items to fetch from message(s) as string (if only one item) or array of strings
-
int
$from: message for items or start message if $to !== null
-
int|null
$to: if null only one message ($from) is fetched, else it's the last message, INF means last message avaible
get mailbox list
this method can't be named after the IMAP command 'LIST', as list is a reserved keyword
array
listMailbox
([string $reference = ''], [string $mailbox = '*'])
-
string
$reference: mailbox reference for list
-
string
$mailbox: mailbox name match with wildcards
Login to IMAP server.
bool
login
(string $user, string $password)
-
string
$user: username
-
string
$password: password
logout of imap server
bool
logout
()
read a response "line" (could also be more than one real line if response has {..}<NL>) and do a simple decode
bool
readLine
([ &$tokens = array()], [string $wantedTag = '*'], [bool $dontParse = false], array|string $tokens)
-
array|string
$tokens: decoded tokens are returned by reference, if $dontParse is true the unparsed line is returned here
-
string
$wantedTag: check for this tag for response code. Default '*' is continuation tag.
-
bool
$dontParse: if true only the unparsed line is returned $tokens
-
&$tokens
read all lines of response until given tag is found (last line of response)
null|bool|array
readResponse
(string $tag, [bool $dontParse = false], string|array $filter)
-
string
$tag: the tag of your request
-
string|array
$filter: you can filter the response so you get only the given response lines
-
bool
$dontParse: if true every line is returned unparsed instead of the decoded tokens
send a request and get response at once
mixed
requestAndResponse
(string $command, [array $tokens = array()], [bool $dontParse = false])
-
string
$command: command as in sendRequest()
-
array
$tokens: parameters as in sendRequest()
-
bool
$dontParse: if true unparsed lines are returned instead of tokens
change folder
bool|array
select
([string $box = 'INBOX'])
-
string
$box: change to this folder
send a request
null
sendRequest
(string $command, [array $tokens = array()], [ &$tag = null], string $tag)
-
string
$command: your request command
-
array
$tokens: additional parameters to command, use escapeString() to prepare
-
string
$tag: provide a tag otherwise an autogenerated is returned
-
&$tag
get next line and assume it starts with $start. some requests give a simple feedback so we can quickly check if we can go on.
bool
_assumedNextLine
(string $start)
-
string
$start: the first bytes we assume to be in the next line
split a given line in tokens. a token is literal of any form or a list
array
_decodeLine
(string $line)
-
string
$line: line to decode
get the next line from socket with error checking, but nothing else
string
_nextLine
()
get next line and split the tag. that's the normal case for a response line
string
_nextTaggedLine
( &$tag, string $tag)
-
string
$tag: tag of line is returned by reference
-
&$tag