1483. Class

1483.1. Zend\Mail\Protocol\Pop3

1483.1.1. Methods

1483.1.1.1. __construct

__construct()

Public constructor

Parameters:
  • string – hostname or IP address of POP3 server, if given connect() is called
  • int|null – port of POP3 server, null for default (110 or 995 for ssl)
  • bool|string – use ssl? ‘SSL’, ‘TLS’ or false

1483.1.1.2. __destruct

__destruct()

Public destructor

1483.1.1.3. connect

connect()

Open connection to POP3 server

Parameters:
  • string – hostname or IP address of POP3 server
  • int|null – of POP3 server, default is 110 (995 for ssl)
  • string|bool – use ‘SSL’, ‘TLS’ or false
Throws ExceptionRuntimeException:
 
Return type:

string welcome message

1483.1.1.4. sendRequest

sendRequest()

Send a request

Parameters:string – your request without newline
Throws ExceptionRuntimeException:
 

1483.1.1.5. readResponse

readResponse()

read a response

Parameters:bool – response has multiple lines and should be read until “<nl>.<nl>”
Throws ExceptionRuntimeException:
 
Return type:string response

1483.1.1.6. request

request()

Send request and get response

Parameters:
  • string – request
  • bool – multiline response?
Return type:

string result from readResponse()

1483.1.1.7. logout

logout()

End communication with POP3 server (also closes socket)

1483.1.1.8. capa

capa()

Get capabilities from POP3 server

Return type:array list of capabilities

1483.1.1.9. login

login()

Login to POP3 server. Can use APOP

Parameters:
  • string – username
  • string – password
  • bool – should APOP be tried?

1483.1.1.10. status

status()

Make STAT call for message count and size sum

Parameters:
  • int – out parameter with count of messages
  • int – out parameter with size in octets of messages

1483.1.1.11. getList

getList()

Make LIST call for size of message(s)

Parameters:int|null – number of message, null for all
Return type:int|array size of given message or list with array(num => size)

1483.1.1.12. uniqueid

uniqueid()

Make UIDL call for getting a uniqueid

Parameters:int|null – number of message, null for all
Return type:string|array uniqueid of message or list with array(num => uniqueid)

1483.1.1.13. top

top()

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

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

Parameters:
  • int – number of message
  • int – number of wanted body lines (empty line is inserted after header lines)
  • bool – fallback with full retrieve if top is not supported
Throws ExceptionRuntimeException:
 
Throws ExceptionExceptionInterface:
 
Return type:

string message headers with wanted body lines

1483.1.1.14. retrieve

retrieve()

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

Parameters:int – message number
Return type:string message

1483.1.1.15. noop

noop()

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

1483.1.1.16. delete

delete()

Make a DELE count to remove a message

Parameters:$msgno

1483.1.1.17. undelete

undelete()

Make RSET call, which rollbacks delete requests

1483.1.2. Constants

1483.1.2.1. TIMEOUT_CONNECTION

Default timeout in seconds for initiating session