PHP Класс PHPMailer\PHPMailer\POP3

Specifically for PHPMailer to use for RFC1939 POP-before-SMTP authentication. 1) This class does not support APOP authentication. 2) Opening and closing lots of POP3 connections can be quite slow. If you need to send a batch of emails then just perform the authentication once at the start, and then loop through your mail sending script. Providing this process doesn't take longer than the verification period lasts on your POP3 server, you should be fine. 3) This is really ancient technology; you should only need to use it to talk to very old systems. 4) This POP3 class is deliberately lightweight and incomplete, and implements just enough to do authentication. If you want a more complete class there are other POP3 classes for PHP available.
Автор: Richard Davey (original author) ([email protected])
Автор: Marcus Bointon (Synchro/coolbru) ([email protected])
Автор: Jim Jagielski (jimjag) ([email protected])
Автор: Andy Prevost (codeworxtech) ([email protected])
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
$POP3_PORT integer Default POP3 port number.
$POP3_TIMEOUT integer Default timeout in seconds.
$Version string The POP3 PHPMailer Version number.
$do_debug integer Options: 0 = no, 1+ = yes
$host string POP3 mail server hostname.
$password string POP3 password.
$port integer POP3 port number.
$tval integer POP3 Timeout Value in seconds.
$username string POP3 username

Защищенные свойства (Protected)

Свойство Тип Описание
$connected boolean Are we connected?
$errors array Error container.
$pop_conn resource Resource handle for the POP3 connection socket.

Открытые методы

Метод Описание
authorise ( string $host, integer | boolean $port = false, integer | boolean $timeout = false, string $username = '', string $password = '', integer $debug_level ) : boolean Authenticate with a POP3 server.
connect ( string $host, integer | boolean $port = false, integer $tval = 30 ) : boolean Connect to a POP3 server.
disconnect ( ) Disconnect from the POP3 server.
getErrors ( ) : array Get an array of error messages, if any.
login ( string $username = '', string $password = '' ) : boolean Log in to the POP3 server.
popBeforeSmtp ( $host, integer | boolean $port = false, integer | boolean $timeout = false, string $username = '', string $password = '', integer $debug_level ) : boolean Simple static wrapper for all-in-one POP before SMTP

Защищенные методы

Метод Описание
catchWarning ( integer $errno, string $errstr, string $errfile, integer $errline ) POP3 connection error handler.
checkResponse ( string $string ) : boolean Checks the POP3 server response.
getResponse ( integer $size = 128 ) : string Get a response from the POP3 server.
sendString ( string $string ) : integer Send raw data to the POP3 server.
setError ( $error ) Add an error to the internal error store.

Описание методов

authorise() публичный Метод

A connect, login, disconnect sequence appropriate for POP-before SMTP authorisation.
public authorise ( string $host, integer | boolean $port = false, integer | boolean $timeout = false, string $username = '', string $password = '', integer $debug_level ) : boolean
$host string The hostname to connect to
$port integer | boolean The port number to connect to
$timeout integer | boolean The timeout value
$username string
$password string
$debug_level integer
Результат boolean

catchWarning() защищенный Метод

POP3 connection error handler.
protected catchWarning ( integer $errno, string $errstr, string $errfile, integer $errline )
$errno integer
$errstr string
$errfile string
$errline integer

checkResponse() защищенный Метод

Looks for for +OK or -ERR.
protected checkResponse ( string $string ) : boolean
$string string
Результат boolean

connect() публичный Метод

Connect to a POP3 server.
public connect ( string $host, integer | boolean $port = false, integer $tval = 30 ) : boolean
$host string
$port integer | boolean
$tval integer
Результат boolean

disconnect() публичный Метод

Disconnect from the POP3 server.
public disconnect ( )

getErrors() публичный Метод

Get an array of error messages, if any.
public getErrors ( ) : array
Результат array

getResponse() защищенный Метод

$size is the maximum number of bytes to retrieve
protected getResponse ( integer $size = 128 ) : string
$size integer
Результат string

login() публичный Метод

Does not support APOP (RFC 2828, 4949).
public login ( string $username = '', string $password = '' ) : boolean
$username string
$password string
Результат boolean

popBeforeSmtp() публичный статический Метод

Simple static wrapper for all-in-one POP before SMTP
public static popBeforeSmtp ( $host, integer | boolean $port = false, integer | boolean $timeout = false, string $username = '', string $password = '', integer $debug_level ) : boolean
$host
$port integer | boolean The port number to connect to
$timeout integer | boolean The timeout value
$username string
$password string
$debug_level integer
Результат boolean

sendString() защищенный Метод

Send raw data to the POP3 server.
protected sendString ( string $string ) : integer
$string string
Результат integer

setError() защищенный Метод

Also display debug output if it's enabled.
protected setError ( $error )
$error

Описание свойств

$POP3_PORT публичное свойство

Default POP3 port number.
public int $POP3_PORT
Результат integer

$POP3_TIMEOUT публичное свойство

Default timeout in seconds.
public int $POP3_TIMEOUT
Результат integer

$Version публичное свойство

The POP3 PHPMailer Version number.
public string $Version
Результат string

$connected защищенное свойство

Are we connected?
protected bool $connected
Результат boolean

$do_debug публичное свойство

Options: 0 = no, 1+ = yes
public int $do_debug
Результат integer

$errors защищенное свойство

Error container.
protected array $errors
Результат array

$host публичное свойство

POP3 mail server hostname.
public string $host
Результат string

$password публичное свойство

POP3 password.
public string $password
Результат string

$pop_conn защищенное свойство

Resource handle for the POP3 connection socket.
protected resource $pop_conn
Результат resource

$port публичное свойство

POP3 port number.
public int $port
Результат integer

$tval публичное свойство

POP3 Timeout Value in seconds.
public int $tval
Результат integer

$username публичное свойство

POP3 username
public string $username
Результат string