Zend Framework  1.12
Public Member Functions | Public Attributes | Protected Attributes | List of all members
Zend_Mail_Protocol_Pop3 Class Reference

Public Member Functions

 __construct ($host= '', $port=null, $ssl=false)
 Public constructor.
 
 __destruct ()
 Public destructor.
 
 connect ($host, $port=null, $ssl=false)
 Open connection to POP3 server.
 
 sendRequest ($request)
 Send a request.
 
 readResponse ($multiline=false)
 read a response
 
 request ($request, $multiline=false)
 Send request and get resposne.
 
 logout ()
 End communication with POP3 server (also closes socket)
 
 capa ()
 Get capabilities from POP3 server.
 
 login ($user, $password, $tryApop=true)
 Login to POP3 server.
 
 status (&$messages, &$octets)
 Make STAT call for message count and size sum.
 
 getList ($msgno=null)
 Make LIST call for size of message(s)
 
 uniqueid ($msgno=null)
 Make UIDL call for getting a uniqueid.
 
 top ($msgno, $lines=0, $fallback=false)
 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.
 
 retrive ($msgno)
 Make a RETR call for retrieving a full message with headers and body.
 
 retrieve ($msgno)
 Make a RETR call for retrieving a full message with headers and body.
 
 noop ()
 Make a NOOP call, maybe needed for keeping the server happy.
 
 delete ($msgno)
 Make a DELE count to remove a message.
 
 undelete ()
 Make RSET call, which rollbacks delete requests.
 

Public Attributes

const TIMEOUT_CONNECTION = 30
 Default timeout in seconds for initiating session.
 
 $hasTop = null
 

Protected Attributes

 $_socket
 
 $_timestamp
 

Constructor & Destructor Documentation

__construct (   $host = '',
  $port = null,
  $ssl = false 
)

Public constructor.

Parameters
string$hosthostname or IP address of POP3 server, if given connect() is called
int | null$portport of POP3 server, null for default (110 or 995 for ssl)
bool | string$ssluse ssl? 'SSL', 'TLS' or false
Exceptions
Zend_Mail_Protocol_Exception
__destruct ( )

Public destructor.

Member Function Documentation

capa ( )

Get capabilities from POP3 server.

Returns
array list of capabilities
Exceptions
Zend_Mail_Protocol_Exception
connect (   $host,
  $port = null,
  $ssl = false 
)

Open connection to POP3 server.

Parameters
string$hosthostname or IP address of POP3 server
int | null$portof POP3 server, default is 110 (995 for ssl)
string | bool$ssluse 'SSL', 'TLS' or false
Returns
string welcome message
Exceptions
Zend_Mail_Protocol_Exception
See Also
Zend_Mail_Protocol_Exception
Zend_Mail_Protocol_Exception
delete (   $msgno)

Make a DELE count to remove a message.

Returns
null
Exceptions
Zend_Mail_Protocol_Exception
getList (   $msgno = null)

Make LIST call for size of message(s)

Parameters
int | null$msgnonumber of message, null for all
Returns
int|array size of given message or list with array(num => size)
Exceptions
Zend_Mail_Protocol_Exception
login (   $user,
  $password,
  $tryApop = true 
)

Login to POP3 server.

Can use APOP

Parameters
string$userusername
string$passwordpassword
bool$try_apopshould APOP be tried?
Returns
void
Exceptions
Zend_Mail_Protocol_Exception
logout ( )

End communication with POP3 server (also closes socket)

Returns
null
noop ( )

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

Returns
null
Exceptions
Zend_Mail_Protocol_Exception
readResponse (   $multiline = false)

read a response

Parameters
boolean$multilineresponse has multiple lines and should be read until "<nl>.<nl>"
Returns
string response
Exceptions
Zend_Mail_Protocol_Exception
See Also
Zend_Mail_Protocol_Exception
Zend_Mail_Protocol_Exception
request (   $request,
  $multiline = false 
)

Send request and get resposne.

See Also
sendRequest(), readResponse()
Parameters
string$requestrequest
bool$multilinemultiline response?
Returns
string result from readResponse()
Exceptions
Zend_Mail_Protocol_Exception
retrieve (   $msgno)

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

Parameters
int$msgnomessage number
Returns
string message
Exceptions
Zend_Mail_Protocol_Exception
retrive (   $msgno)

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

Deprecated:
since 1.1.0; this method has a typo - please use retrieve()
Parameters
int$msgnomessage number
Returns
string message
Exceptions
Zend_Mail_Protocol_Exception
sendRequest (   $request)

Send a request.

Parameters
string$requestyour request without newline
Returns
null
Exceptions
Zend_Mail_Protocol_Exception
See Also
Zend_Mail_Protocol_Exception
status ( $messages,
$octets 
)

Make STAT call for message count and size sum.

Parameters
int$messagesout parameter with count of messages
int$octetsout parameter with size in octects of messages
Returns
void
Exceptions
Zend_Mail_Protocol_Exception
top (   $msgno,
  $lines = 0,
  $fallback = false 
)

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 normale RETR call, which retrieves the whole message. Additional lines are not removed.

Parameters
int$msgnonumber of message
int$linesnumber of wanted body lines (empty line is inserted after header lines)
bool$fallbackfallback with full retrieve if top is not supported
Returns
string message headers with wanted body lines
Exceptions
Zend_Mail_Protocol_Exception
See Also
Zend_Mail_Protocol_Exception
undelete ( )

Make RSET call, which rollbacks delete requests.

Returns
null
Exceptions
Zend_Mail_Protocol_Exception
uniqueid (   $msgno = null)

Make UIDL call for getting a uniqueid.

Parameters
int | null$msgnonumber of message, null for all
Returns
string|array uniqueid of message or list with array(num => uniqueid)
Exceptions
Zend_Mail_Protocol_Exception

Member Data Documentation

$_socket
protected
$_timestamp
protected
$hasTop = null
const TIMEOUT_CONNECTION = 30

Default timeout in seconds for initiating session.