category Zend
package Zend_Mail
subpackage Protocol
copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
license New BSD License

 Methods

Public constructor

__construct(string $host = '', integer|null $port = null, boolean|string $ssl = false

Parameters

$host

string

hostname or IP address of POP3 server, if given connect() is called

$port

integernull

port of POP3 server, null for default (110 or 995 for ssl)

$ssl

booleanstring

use ssl? 'SSL', 'TLS' or false

Exceptions

\Zend_Mail_Protocol_Exception

Public destructor

__destruct() 

Get capabilities from POP3 server

capa() : array

Exceptions

\Zend_Mail_Protocol_Exception

Returns

arraylist of capabilities

Open connection to POP3 server

connect(string $host, integer|null $port = null, string|boolean $ssl = false) : string

Parameters

$host

string

hostname or IP address of POP3 server

$port

integernull

of POP3 server, default is 110 (995 for ssl)

$ssl

stringboolean

use 'SSL', 'TLS' or false

Exceptions

\Zend_Mail_Protocol_Exception

Returns

stringwelcome message

Make a DELE count to remove a message

delete($msgno) : null

Parameters

$msgno

Exceptions

\Zend_Mail_Protocol_Exception

Returns

null

Make LIST call for size of message(s)

getList(integer|null $msgno = null) : integer | array

Parameters

$msgno

integernull

number of message, null for all

Exceptions

\Zend_Mail_Protocol_Exception

Returns

integerarraysize of given message or list with array(num => size)

End communication with POP3 server (also closes socket)

logout() : null

Returns

null

Make a NOOP call, maybe needed for keeping the server happy

noop() : null

Exceptions

\Zend_Mail_Protocol_Exception

Returns

null

read a response

readResponse(boolean $multiline = false) : string

Parameters

$multiline

boolean

response has multiple lines and should be read until "."

Exceptions

\Zend_Mail_Protocol_Exception

Returns

stringresponse

Send request and get resposne

request(string $request, boolean $multiline = false) : string
see readResponse()

Parameters

$request

string

request

$multiline

boolean

multiline response?

Exceptions

\Zend_Mail_Protocol_Exception

Returns

stringresult from readResponse()

Make a RETR call for retrieving a full message with headers and body

retrieve(integer $msgno) : string

Parameters

$msgno

integer

message number

Exceptions

\Zend_Mail_Protocol_Exception

Returns

stringmessage

Make a RETR call for retrieving a full message with headers and body

retrive(integer $msgno) : string
deprecated since 1.1.0; this method has a typo - please use retrieve()

Parameters

$msgno

integer

message number

Exceptions

\Zend_Mail_Protocol_Exception

Returns

stringmessage

Send a request

sendRequest(string $request) : null

Parameters

$request

string

your request without newline

Exceptions

\Zend_Mail_Protocol_Exception

Returns

null

Make STAT call for message count and size sum

status(integer $messages, integer $octets) : void

Parameters

$messages

integer

out parameter with count of messages

$octets

integer

out parameter with size in octects of messages

Exceptions

\Zend_Mail_Protocol_Exception

Make TOP call for getting headers and maybe some body lines This method also sets hasTop - before it it's not known if top is supported

top(integer $msgno, integer $lines = 0, boolean $fallback = false) : string

The fallback makes normale RETR call, which retrieves the whole message. Additional lines are not removed.

Parameters

$msgno

integer

number of message

$lines

integer

number of wanted body lines (empty line is inserted after header lines)

$fallback

boolean

fallback with full retrieve if top is not supported

Exceptions

\Zend_Mail_Protocol_Exception

Returns

stringmessage headers with wanted body lines

Make RSET call, which rollbacks delete requests

undelete() : null

Exceptions

\Zend_Mail_Protocol_Exception

Returns

null

Make UIDL call for getting a uniqueid

uniqueid(integer|null $msgno = null) : string | array

Parameters

$msgno

integernull

number of message, null for all

Exceptions

\Zend_Mail_Protocol_Exception

Returns

stringarrayuniqueid of message or list with array(num => uniqueid)

 Properties

 

saves if server supports top

$hasTop : null | boolean

Default

null
 

socket to pop3

$_socket : null | resource

Default

 

greeting timestamp for apop

$_timestamp : null | string

Default

 Constants

 

Default timeout in seconds for initiating session

TIMEOUT_CONNECTION = 30