Mail/Protocol/Pop3.php
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


TIMEOUT_CONNECTION
= 30Default timeout in seconds for initiating session
Properties



null|bool $hasTop = nullsaves if server supports top
Default valuenullDetails- Type
- null | bool
Methods



__construct(string $host = '', int | null $port = null, bool | string $ssl = false) : voidParameters| Name | Type | Description |
|---|
| $host | string | hostname or IP address of POP3 server, if given connect() is called |
|---|
| $port | int | null | port of POP3 server, null for default (110 or 995 for ssl) |
|---|
| $ssl | bool | string | use ssl? 'SSL', 'TLS' or false |
|---|
Throws 


capa() : arrayGet capabilities from POP3 server
Returns| Type | Description |
|---|
| array | list of capabilities |
Throws 


connect(string $host, int | null $port = null, string | bool $ssl = false) : stringOpen connection to POP3 server
Parameters| Name | Type | Description |
|---|
| $host | string | hostname or IP address of POP3 server |
|---|
| $port | int | null | of POP3 server, default is 110 (995 for ssl) |
|---|
| $ssl | string | bool | use 'SSL', 'TLS' or false |
|---|
Returns| Type | Description |
|---|
| string | welcome message |
Throws 


delete( $msgno) : nullMake a DELE count to remove a message
Parameters| Name | Type | Description |
|---|
| $msgno | | |
|---|
ReturnsThrows 


getList(int | null $msgno = null) : int | arrayMake LIST call for size of message(s)
Parameters| Name | Type | Description |
|---|
| $msgno | int | null | number of message, null for all |
|---|
Returns| Type | Description |
|---|
| int | array | size of given message or list with array(num => size) |
Throws 


login(string $user, string $password, $tryApop = true) : voidLogin to POP3 server. Can use APOP
Parameters| Name | Type | Description |
|---|
| $user | string | username |
|---|
| $password | string | password |
|---|
| $tryApop | | |
|---|
Throws 


readResponse(boolean $multiline = false) : stringParameters| Name | Type | Description |
|---|
| $multiline | boolean | response has multiple lines and should be read until "." |
|---|
Returns| Type | Description |
|---|
| string | response |
Throws 


request(string $request, bool $multiline = false) : stringSend request and get resposne
Parameters| Name | Type | Description |
|---|
| $request | string | request |
|---|
| $multiline | bool | multiline response? |
|---|
Returns| Type | Description |
|---|
| string | result from readResponse() |
ThrowsDetails- See
- readResponse()



retrieve(int $msgno) : stringMake a RETR call for retrieving a full message with headers and body
Parameters| Name | Type | Description |
|---|
| $msgno | int | message number |
|---|
Returns| Type | Description |
|---|
| string | message |
Throws 


retrive(int $msgno) : stringMake a RETR call for retrieving a full message with headers and body
Parameters| Name | Type | Description |
|---|
| $msgno | int | message number |
|---|
Returns| Type | Description |
|---|
| string | message |
ThrowsDetails- Deprecated
- since 1.1.0; this method has a typo - please use retrieve()



sendRequest(string $request) : nullParameters| Name | Type | Description |
|---|
| $request | string | your request without newline |
|---|
ReturnsThrows 


status(int $messages, int $octets) : voidMake STAT call for message count and size sum
Parameters| Name | Type | Description |
|---|
| $messages | int | out parameter with count of messages |
|---|
| $octets | int | out parameter with size in octects of messages |
|---|
Throws 


top(int $msgno, int $lines = 0, bool $fallback = false) : stringMake 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| Name | Type | Description |
|---|
| $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 |
|---|
Returns| Type | Description |
|---|
| string | message headers with wanted body lines |
Throws


uniqueid(int | null $msgno = null) : string | arrayMake UIDL call for getting a uniqueid
Parameters| Name | Type | Description |
|---|
| $msgno | int | null | number of message, null for all |
|---|
Returns| Type | Description |
|---|
| string | array | uniqueid of message or list with array(num => uniqueid) |
Throws