Mail/Protocol/Pop3.php

Show: PublicProtectedPrivateinherited
Table of Contents
Zend Framework
LICENSE This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.
Category
Zend  
Copyright
Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Mail  
Subpackage
Protocol  
Version
$Id$  

\Zend_Mail_Protocol_Pop3

Package: Zend_Mail\Protocol
Category
Zend  
Copyright
Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Constants

>VConstant  TIMEOUT_CONNECTION = 30
Default timeout in seconds for initiating session

Properties

>VPropertyprotectednull|resource $_socket
socket to pop3
Details
Type
null | resource
>VPropertyprotectednull|string $_timestamp
greeting timestamp for apop
Details
Type
null | string
>VPropertypublicnull|bool $hasTop = null
saves if server supports top
Default valuenullDetails
Type
null | bool

Methods

methodpublic__construct(string $host = '', int | null $port = null, bool | string $ssl = false) : void

Public constructor

Parameters
NameTypeDescription
$hoststring

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

$portint | null

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

$sslbool | string

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

Throws
ExceptionDescription
\Zend_Mail_Protocol_Exception
methodpublic__destruct() : void

Public destructor

methodpubliccapa() : array

Get capabilities from POP3 server

Returns
TypeDescription
arraylist of capabilities
Throws
ExceptionDescription
\Zend_Mail_Protocol_Exception
methodpublicconnect(string $host, int | null $port = null, string | bool $ssl = false) : string

Open connection to POP3 server

Parameters
NameTypeDescription
$hoststring

hostname or IP address of POP3 server

$portint | null

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

$sslstring | bool

use 'SSL', 'TLS' or false

Returns
TypeDescription
stringwelcome message
Throws
ExceptionDescription
\Zend_Mail_Protocol_Exception
methodpublicdelete( $msgno) : null

Make a DELE count to remove a message

Parameters
NameTypeDescription
$msgno
Returns
TypeDescription
null
Throws
ExceptionDescription
\Zend_Mail_Protocol_Exception
methodpublicgetList(int | null $msgno = null) : int | array

Make LIST call for size of message(s)

Parameters
NameTypeDescription
$msgnoint | null

number of message, null for all

Returns
TypeDescription
int | arraysize of given message or list with array(num => size)
Throws
ExceptionDescription
\Zend_Mail_Protocol_Exception
methodpubliclogin(string $user, string $password,  $tryApop = true) : void

Login to POP3 server. Can use APOP

Parameters
NameTypeDescription
$userstring

username

$passwordstring

password

$tryApop
Throws
ExceptionDescription
\Zend_Mail_Protocol_Exception
methodpubliclogout() : null

End communication with POP3 server (also closes socket)

Returns
TypeDescription
null
methodpublicnoop() : null

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

Returns
TypeDescription
null
Throws
ExceptionDescription
\Zend_Mail_Protocol_Exception
methodpublicreadResponse(boolean $multiline = false) : string

read a response

Parameters
NameTypeDescription
$multilineboolean

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

Returns
TypeDescription
stringresponse
Throws
ExceptionDescription
\Zend_Mail_Protocol_Exception
methodpublicrequest(string $request, bool $multiline = false) : string

Send request and get resposne

Parameters
NameTypeDescription
$requeststring

request

$multilinebool

multiline response?

Returns
TypeDescription
stringresult from readResponse()
Throws
ExceptionDescription
\Zend_Mail_Protocol_Exception
Details
See
readResponse()  
methodpublicretrieve(int $msgno) : string

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

Parameters
NameTypeDescription
$msgnoint

message number

Returns
TypeDescription
stringmessage
Throws
ExceptionDescription
\Zend_Mail_Protocol_Exception
methodpublicretrive(int $msgno) : string

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

Parameters
NameTypeDescription
$msgnoint

message number

Returns
TypeDescription
stringmessage
Throws
ExceptionDescription
\Zend_Mail_Protocol_Exception
Details
Deprecated
since 1.1.0; this method has a typo - please use retrieve()  
methodpublicsendRequest(string $request) : null

Send a request

Parameters
NameTypeDescription
$requeststring

your request without newline

Returns
TypeDescription
null
Throws
ExceptionDescription
\Zend_Mail_Protocol_Exception
methodpublicstatus(int $messages, int $octets) : void

Make STAT call for message count and size sum

Parameters
NameTypeDescription
$messagesint

out parameter with count of messages

$octetsint

out parameter with size in octects of messages

Throws
ExceptionDescription
\Zend_Mail_Protocol_Exception
methodpublictop(int $msgno, int $lines = 0, bool $fallback = false) : string

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
NameTypeDescription
$msgnoint

number of message

$linesint

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

$fallbackbool

fallback with full retrieve if top is not supported

Returns
TypeDescription
stringmessage headers with wanted body lines
Throws
ExceptionDescription
\Zend_Mail_Protocol_Exception
methodpublicundelete() : null

Make RSET call, which rollbacks delete requests

Returns
TypeDescription
null
Throws
ExceptionDescription
\Zend_Mail_Protocol_Exception
methodpublicuniqueid(int | null $msgno = null) : string | array

Make UIDL call for getting a uniqueid

Parameters
NameTypeDescription
$msgnoint | null

number of message, null for all

Returns
TypeDescription
string | arrayuniqueid of message or list with array(num => uniqueid)
Throws
ExceptionDescription
\Zend_Mail_Protocol_Exception
Documentation was generated by phpDocumentor 2.2.0 .