Class Zend_Mail_Transport_Imap

Description

Located in /Mail/Transport/Imap.php (line 30)


	
			
Method Summary
 Zend_Mail_Transport_Imap __construct ([string $host = ''], [int $port = null], [bool $ssl = false])
 void __destruct ()
 array capability ()
 string connect (string $host, [int $port = null], [string $ssl = false])
 string escapeList (array $list)
 string|array escapeString (string|array $string)
 bool|array examine ([string $box = 'INBOX'])
 bool|array examineOrSelect ([string $command = 'EXAMINE'], [string $box = 'INBOX'])
 string|array fetch (string|array $items, int $from, [int|null $to = null])
 array listMailbox ([ $reference = ''], [ $mailbox = '*'])
 bool login (string $user, string $password)
 bool logout ()
 bool readLine ([ &$tokens = array()], [string $wantedTag = '*'], [bool $dontParse = false], array|string $tokens)
 null|bool|array readResponse (string $tag, [bool $dontParse = false], string|array $filter)
 mixed requestAndResponse (string $command, [array $tokens = array()], [bool $dontParse = false])
 bool|array select ([string $box = 'INBOX'])
 void sendRequest (string $command, [array $tokens = array()], [ &$tag = null], string $tag)
Methods
Constructor __construct (line 45)

Public constructor

Zend_Mail_Transport_Imap __construct ([string $host = ''], [int $port = null], [bool $ssl = false])
  • string $host: hostname of IP address of IMAP server, if given connect() is called
  • int $port: port of IMAP server, default is 143 (993 for ssl)
  • bool $ssl: use ssl?
Destructor __destruct (line 55)

Public destructor

  • access: public
void __destruct ()
capability (line 419)

Get capabilities from IMAP server

  • return: list of capabilities
  • access: public
array capability ()
connect (line 69)

Open connection to POP3 server

  • return: welcome message
  • access: public
  • throws: Zend_Mail_Transport_Exception
string connect (string $host, [int $port = null], [string $ssl = false])
  • string $host: hostname of IP address of POP3 server
  • int $port: of IMAP server, default is 143 (993 for ssl)
  • string $ssl: use 'SSL' or 'TLS'
escapeList (line 367)

escape a list with literals or lists

  • return: escaped list for imap
  • access: public
string escapeList (array $list)
  • array $list: list with literals or lists as PHP array
escapeString (line 345)

escape one or more literals i.e. for sendRequest

  • return: escape literals, literals with newline ar returned as array('{size}', 'string');
  • access: public
string|array escapeString (string|array $string)
  • string|array $string: the literal/-s
examine (line 491)

examine folder

  • return: see examineOrselect()
  • access: public
bool|array examine ([string $box = 'INBOX'])
  • string $box: examine this folder
examineOrSelect (line 444)

Examine and select have the same response. The common code for both is in this method

  • return: false if error, array with returned information otherwise (flags, exists, recent, uidvalidity)
  • access: public
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 (line 509)

fetch one or more items of one or more messages

  • return: if 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 fetchted it's returned as (msgno => (name => value))
  • access: public
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
listMailbox (line 565)

get mailbox list

this method can't be named after the IMAP command 'LIST', as list is a reserved keyword

  • return: mailboxes that matched $mailbox as array(globalName => array('delim' => .., 'flags' => ..))
  • access: public
array listMailbox ([ $reference = ''], [ $mailbox = '*'])
  • $reference
  • $mailbox
login (line 388)

Login to IMAP server.

  • return: success
  • access: public
bool login (string $user, string $password)
  • string $user: username
  • string $password: password
logout (line 398)

logout of imap server

  • return: success
  • access: public
bool logout ()
readLine (line 247)

read a response "line" (could also be more than one real line if response has {..}<NL>) and do a simple decode

  • return: if returned tag matches wanted tag
  • access: public
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
readResponse (line 270)

read all lines of response until given tag is found (last line of response)

  • return: tokens if success, false if error, null if bad request
  • access: public
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
requestAndResponse (line 330)

send a request and get response at once

  • return: response as in readResponse()
  • access: public
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
select (line 480)

change folder

  • return: see examineOrselect()
  • access: public
bool|array select ([string $box = 'INBOX'])
  • string $box: change to this folder
sendRequest (line 299)

send a request

  • access: public
  • throws: Zend_Mail_Transport_Exception
void 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

Documentation generated on Thu, 18 Jan 2007 10:00:55 -0800 by phpDocumentor 1.3.1