Definition at line 47 of file Pop3.php.
◆ __construct()
create instance with parameters Supported paramters are
- host hostname or ip address of POP3 server
- user username
- password password for user 'username' [optional, default = '']
- port port for POP3 server [optional, default = 110]
- ssl 'SSL' or 'TLS' for secure sockets
- Parameters
-
array | $params | mail reader specific parameters |
- Exceptions
-
- See also
- Zend_Mail_Storage_Exception
Definition at line 161 of file Pop3.php.
167 $this->_has[
'fetchPart'] =
false;
168 $this->_has[
'top'] =
null;
169 $this->_has[
'uniqueid'] =
null;
180 #require_once 'Zend/Mail/Storage/Exception.php'; 190 $this->_protocol->connect($host, $port, $ssl);
191 $this->_protocol->login(
$params->user, $password);
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE]
◆ __get()
Special handling for hasTop and hasUniqueid. The headers of the first message is retrieved if Top wasn't needed/tried yet.
- See also
- Zend_Mail_Storage_Abstract:__get()
- Parameters
-
- Returns
- string
- Exceptions
-
Definition at line 295 of file Pop3.php.
302 if (strtolower($var) ==
'hastop') {
303 if ($this->_protocol->hasTop ===
null) {
306 $this->_protocol->top(1, 0,
false);
311 $this->_has[
'top'] = $this->_protocol->hasTop;
312 return $this->_protocol->hasTop;
315 if (strtolower($var) ==
'hasuniqueid') {
318 $id = $this->_protocol->uniqueid(1);
322 $this->_has[
'uniqueid'] =
$id ? true :
false;
323 return $this->_has[
'uniqueid'];
◆ close()
Close resource for mail lib. If you need to control, when the resource is closed. Otherwise the destructor would call this.
- Returns
- null
Definition at line 200 of file Pop3.php.
202 $this->_protocol->logout();
◆ countMessages()
Count messages all messages in current box
- Returns
- int number of messages
- Exceptions
-
Definition at line 63 of file Pop3.php.
65 $this->_protocol->status(
$count, $null);
◆ getMessage()
Fetch a message
- Parameters
-
- Returns
- Zend_Mail_Message
- Exceptions
-
Definition at line 89 of file Pop3.php.
92 $message = $this->_protocol->top(
$id, $bodyLines,
true);
94 return new $this->_messageClass(array(
'handler' => $this,
'id' =>
$id,
'headers' =>
$message,
95 'noToplines' => $bodyLines < 1));
◆ getNumberByUniqueId()
getNumberByUniqueId |
( |
|
$id | ) |
|
get a message number from a unique id
I.e. if you have a webmailer that supports deleting messages you should use unique ids as parameter and use this method to translate it to message number right before calling removeMessage()
- Parameters
-
- Returns
- int message number
- Exceptions
-
- See also
- Zend_Mail_Storage_Exception
Definition at line 266 of file Pop3.php.
268 if (!$this->hasUniqueid) {
273 foreach ($ids as $k => $v) {
282 #require_once 'Zend/Mail/Storage/Exception.php';
◆ getRawContent()
getRawContent |
( |
|
$id, |
|
|
|
$part = null |
|
) |
| |
- See also
- Zend_Mail_Storage_Exception
Definition at line 131 of file Pop3.php.
133 if ($part !==
null) {
138 #require_once 'Zend/Mail/Storage/Exception.php';
static splitMessage( $message, &$headers, &$body, $EOL=Zend_Mime::LINEEND)
◆ getRawHeader()
getRawHeader |
( |
|
$id, |
|
|
|
$part = null , |
|
|
|
$topLines = 0 |
|
) |
| |
◆ getSize()
get a list of messages with number and size
- Parameters
-
- Returns
- int|array size of given message of list with all messages as array(num => size)
- Exceptions
-
Definition at line 76 of file Pop3.php.
79 return $this->_protocol->getList(
$id);
◆ getUniqueId()
getUniqueId |
( |
|
$id = null | ) |
|
get unique id for one or all messages
if storage does not support unique ids it's the same as the message number
- Parameters
-
int | null | $id | message number |
- Returns
- array|string message number for given message or all messages as array
- Exceptions
-
Definition at line 239 of file Pop3.php.
241 if (!$this->hasUniqueid) {
249 $range = range(1,
$count);
250 return array_combine($range, $range);
253 return $this->_protocol->uniqueid(
$id);
◆ noop()
Keep the server busy.
- Returns
- null
- Exceptions
-
Definition at line 211 of file Pop3.php.
213 return $this->_protocol->noop();
◆ removeMessage()
Remove a message from server. If you're doing that from a web enviroment you should be careful and use a uniqueid as parameter if possible to identify the message.
- Parameters
-
- Returns
- null
- Exceptions
-
Definition at line 225 of file Pop3.php.
227 $this->_protocol->delete(
$id);
◆ $_protocol
The documentation for this class was generated from the following file:
- vendor/magento/zendframework1/library/Zend/Mail/Storage/Pop3.php