Methods

Public constructor

__construct(string $host, int | null $port, bool | string $ssl) 

Parameters

$host

string

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

$port

intnull

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

$ssl

boolstring

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, int | null $port, string | bool $ssl) : string

Parameters

$host

string

hostname or IP address of POP3 server

$port

intnull

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

$ssl

stringbool

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(int | null $msgno) : int | array

Parameters

$msgno

intnull

number of message, null for all

Returns

intarraysize 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(bool $multiline) : string

Parameters

$multiline

bool

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, bool $multiline) : string

see \Zend\Mail\Protocol\sendRequest()
see \Zend\Mail\Protocol\readResponse()

Parameters

$request

string

request

$multiline

bool

multiline response?

Returns

stringresult from readResponse()

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

retrieve(int $msgno) : string

Parameters

$msgno

int

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(int $messages, int $octets) 

Parameters

$messages

int

out parameter with count of messages

$octets

int

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(int $msgno, int $lines, bool $fallback) : string

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

Parameters

$msgno

int

number of message

$lines

int

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

$fallback

bool

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(int | null $msgno) : string | array

Parameters

$msgno

intnull

number of message, null for all

Returns

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

 Properties

 

saves if server supports top

$hasTop : null | bool

 

socket to pop3

$socket : null | resource

 

greeting timestamp for apop

$timestamp : null | string

 Constants

 

Default timeout in seconds for initiating session

TIMEOUT_CONNECTION