Zend Framework
1.12
|
Public Member Functions | |
__construct ($host= '', $port=null, $ssl=false) | |
Public constructor. | |
__destruct () | |
Public destructor. | |
connect ($host, $port=null, $ssl=false) | |
Open connection to IMAP server. | |
readLine (&$tokens=array(), $wantedTag= '*', $dontParse=false) | |
read a response "line" (could also be more than one real line if response has {..}<NL>) and do a simple decode | |
readResponse ($tag, $dontParse=false) | |
read all lines of response until given tag is found (last line of response) | |
sendRequest ($command, $tokens=array(), &$tag=null) | |
send a request | |
requestAndResponse ($command, $tokens=array(), $dontParse=false) | |
send a request and get response at once | |
escapeString ($string) | |
escape one or more literals i.e. | |
escapeList ($list) | |
escape a list with literals or lists | |
login ($user, $password) | |
Login to IMAP server. | |
logout () | |
logout of imap server | |
capability () | |
Get capabilities from IMAP server. | |
examineOrSelect ($command= 'EXAMINE', $box= 'INBOX') | |
Examine and select have the same response. | |
select ($box= 'INBOX') | |
change folder | |
examine ($box= 'INBOX') | |
examine folder | |
fetch ($items, $from, $to=null) | |
fetch one or more items of one or more messages | |
listMailbox ($reference= '', $mailbox= '*') | |
get mailbox list | |
store (array $flags, $from, $to=null, $mode=null, $silent=true) | |
set flags | |
append ($folder, $message, $flags=null, $date=null) | |
append a new message to given folder | |
copy ($folder, $from, $to=null) | |
copy message set from current folder to other folder | |
create ($folder) | |
create a new folder (and parent folders if needed) | |
rename ($old, $new) | |
rename an existing folder | |
delete ($folder) | |
remove a folder | |
expunge () | |
permanently remove messages | |
noop () | |
send noop | |
search (array $params) | |
do a search request | |
Public Attributes | |
const | TIMEOUT_CONNECTION = 30 |
Default timeout in seconds for initiating session. | |
Protected Member Functions | |
_nextLine () | |
get the next line from socket with error checking, but nothing else | |
_assumedNextLine ($start) | |
get next line and assume it starts with $start. | |
_nextTaggedLine (&$tag) | |
get next line and split the tag. | |
_decodeLine ($line) | |
split a given line in tokens. | |
Protected Attributes | |
$_socket | |
$_tagCount = 0 | |
__construct | ( | $host = '' , |
|
$port = null , |
|||
$ssl = false |
|||
) |
Public constructor.
string | $host | hostname or 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 |
Zend_Mail_Protocol_Exception |
__destruct | ( | ) |
Public destructor.
|
protected |
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.
string | $start | the first bytes we assume to be in the next line |
Zend_Mail_Protocol_Exception |
|
protected |
split a given line in tokens.
a token is literal of any form or a list
string | $line | line to decode |
Zend_Mail_Protocol_Exception |
|
protected |
get the next line from socket with error checking, but nothing else
Zend_Mail_Protocol_Exception |
|
protected |
get next line and split the tag.
that's the normal case for a response line
string | $tag | tag of line is returned by reference |
Zend_Mail_Protocol_Exception |
append | ( | $folder, | |
$message, | |||
$flags = null , |
|||
$date = null |
|||
) |
append a new message to given folder
string | $folder | name of target folder |
string | $message | full message content |
array | $flags | flags for new message |
string | $date | date for new message |
Zend_Mail_Protocol_Exception |
capability | ( | ) |
Get capabilities from IMAP server.
Zend_Mail_Protocol_Exception |
connect | ( | $host, | |
$port = null , |
|||
$ssl = false |
|||
) |
Open connection to IMAP server.
string | $host | hostname or IP address of IMAP server |
int | null | $port | of IMAP server, default is 143 (993 for ssl) |
string | bool | $ssl | use 'SSL', 'TLS' or false |
Zend_Mail_Protocol_Exception |
copy | ( | $folder, | |
$from, | |||
$to = null |
|||
) |
copy message set from current folder to other folder
string | $folder | destination folder |
int | null | $to | if null only one message ($from) is fetched, else it's the last message, INF means last message avaible |
Zend_Mail_Protocol_Exception |
create | ( | $folder | ) |
create a new folder (and parent folders if needed)
string | $folder | folder name |
delete | ( | $folder | ) |
remove a folder
string | $folder | folder name |
escapeList | ( | $list | ) |
escape a list with literals or lists
array | $list | list with literals or lists as PHP array |
escapeString | ( | $string | ) |
escape one or more literals i.e.
for sendRequest
string | array | $string | the literal/-s |
examine | ( | $box = 'INBOX' | ) |
examine folder
string | $box | examine this folder |
Zend_Mail_Protocol_Exception |
examineOrSelect | ( | $command = 'EXAMINE' , |
|
$box = 'INBOX' |
|||
) |
Examine and select have the same response.
The common code for both is in this method
string | $command | can be 'EXAMINE' or 'SELECT' and this is used as command |
string | $box | which folder to change to or examine |
Zend_Mail_Protocol_Exception |
expunge | ( | ) |
permanently remove messages
fetch | ( | $items, | |
$from, | |||
$to = null |
|||
) |
fetch one or more items of one or more messages
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 |
Zend_Mail_Protocol_Exception |
listMailbox | ( | $reference = '' , |
|
$mailbox = '*' |
|||
) |
get mailbox list
this method can't be named after the IMAP command 'LIST', as list is a reserved keyword
string | $reference | mailbox reference for list |
string | $mailbox | mailbox name match with wildcards |
Zend_Mail_Protocol_Exception |
login | ( | $user, | |
$password | |||
) |
Login to IMAP server.
string | $user | username |
string | $password | password |
Zend_Mail_Protocol_Exception |
logout | ( | ) |
logout of imap server
noop | ( | ) |
send noop
readLine | ( | & | $tokens = array() , |
$wantedTag = '*' , |
|||
$dontParse = false |
|||
) |
read a response "line" (could also be more than one real line if response has {..}<NL>) and do a simple decode
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 |
Zend_Mail_Protocol_Exception |
readResponse | ( | $tag, | |
$dontParse = false |
|||
) |
read all lines of response until given tag is found (last line of response)
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 |
Zend_Mail_Protocol_Exception |
rename | ( | $old, | |
$new | |||
) |
rename an existing folder
string | $old | old name |
string | $new | new name |
requestAndResponse | ( | $command, | |
$tokens = array() , |
|||
$dontParse = false |
|||
) |
send a request and get response at once
string | $command | command as in sendRequest() |
array | $tokens | parameters as in sendRequest() |
bool | $dontParse | if true unparsed lines are returned instead of tokens |
Zend_Mail_Protocol_Exception |
search | ( | array | $params | ) |
do a search request
This method is currently marked as internal as the API might change and is not safe if you don't take precautions.
select | ( | $box = 'INBOX' | ) |
change folder
string | $box | change to this folder |
Zend_Mail_Protocol_Exception |
sendRequest | ( | $command, | |
$tokens = array() , |
|||
& | $tag = null |
||
) |
send a request
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 |
Zend_Mail_Protocol_Exception |
store | ( | array | $flags, |
$from, | |||
$to = null , |
|||
$mode = null , |
|||
$silent = true |
|||
) |
set flags
array | $flags | flags to set, add or remove - see $mode |
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 |
string | null | $mode | '+' to add flags, '-' to remove flags, everything else sets the flags as given |
bool | $silent | if false the return values are the new flags for the wanted messages |
Zend_Mail_Protocol_Exception |
|
protected |
|
protected |
const TIMEOUT_CONNECTION = 30 |
Default timeout in seconds for initiating session.