package Default

 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

Public destructor

__destruct() 

Get capabilities from POP3 server

capa() : array

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\RuntimeException

Returns

stringwelcome message

Make a DELE count to remove a message

delete($msgno) 

Parameters

$msgno

Make LIST call for size of message(s)

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

Parameters

$msgno

integernull

number of message, null for all

Returns

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

End communication with POP3 server (also closes socket)

logout() 

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

noop() 

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\RuntimeException

Returns

stringresponse

Send request and get response

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

Parameters

$request

string

request

$multiline

boolean

multiline response?

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

Returns

stringmessage

Send a request

sendRequest(string $request) 

Parameters

$request

string

your request without newline

Exceptions

\Zend\Mail\Protocol\Exception\RuntimeException

Make STAT call for message count and size sum

status(integer $messages, integer $octets) 

Parameters

$messages

integer

out parameter with count of messages

$octets

integer

out parameter with size in octets of messages

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 normal 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\RuntimeException
\Zend\Mail\Protocol\Exception\ExceptionInterface

Returns

stringmessage headers with wanted body lines

Make RSET call, which rollbacks delete requests

undelete() 

Make UIDL call for getting a uniqueid

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

Parameters

$msgno

integernull

number of message, null for all

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