\PHPMailer\PHPMailerPOP3

PHPMailer POP-Before-SMTP Authentication Class.

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, implementing just enough to do authentication. If you want a more complete class there are other POP3 classes for PHP available.

Summary

Methods
Properties
Constants
popBeforeSmtp()
authorise()
connect()
login()
disconnect()
getErrors()
$do_debug
$host
$port
$tval
$username
$password
VERSION
DEFAULT_PORT
DEFAULT_TIMEOUT
LE
DEBUG_OFF
DEBUG_SERVER
DEBUG_CLIENT
getResponse()
sendString()
checkResponse()
setError()
catchWarning()
$pop_conn
$connected
$errors
N/A
No private methods found
No private properties found
N/A

Constants

VERSION

VERSION = '6.6.4' : string

The POP3 PHPMailer Version number.

DEFAULT_PORT

DEFAULT_PORT = 110 : int

Default POP3 port number.

DEFAULT_TIMEOUT

DEFAULT_TIMEOUT = 30 : int

Default timeout in seconds.

LE

LE = "\r\n"

Line break constant.

DEBUG_OFF

DEBUG_OFF = 0 : int

Debug level for no output.

DEBUG_SERVER

DEBUG_SERVER = 1 : int

Debug level to show server -> client messages also shows clients connection errors or errors from server

DEBUG_CLIENT

DEBUG_CLIENT = 2 : int

Debug level to show client -> server and server -> client messages.

Properties

$do_debug

$do_debug : int

POP3 class debug output mode.

Debug output level. Options:

Type

int

$host

$host : string

POP3 mail server hostname.

Type

string

$port

$port : int

POP3 port number.

Type

int

$tval

$tval : int

POP3 Timeout Value in seconds.

Type

int

$username

$username : string

POP3 username.

Type

string

$password

$password : string

POP3 password.

Type

string

$pop_conn

$pop_conn : resource

Resource handle for the POP3 connection socket.

Type

resource

$connected

$connected : bool

Are we connected?

Type

bool

$errors

$errors : array

Error container.

Type

array

Methods

popBeforeSmtp()

popBeforeSmtp(string  $host, int|bool  $port = false, int|bool  $timeout = false, string  $username = '', string  $password = '', int  $debug_level) : bool

Simple static wrapper for all-in-one POP before SMTP.

Parameters

string $host

The hostname to connect to

int|bool $port

The port number to connect to

int|bool $timeout

The timeout value

string $username
string $password
int $debug_level

Returns

bool —

authorise()

authorise(string  $host, int|bool  $port = false, int|bool  $timeout = false, string  $username = '', string  $password = '', int  $debug_level) : bool

Authenticate with a POP3 server.

A connect, login, disconnect sequence appropriate for POP-before SMTP authorisation.

Parameters

string $host

The hostname to connect to

int|bool $port

The port number to connect to

int|bool $timeout

The timeout value

string $username
string $password
int $debug_level

Returns

bool —

connect()

connect(string  $host, int|bool  $port = false, int  $tval = 30) : bool

Connect to a POP3 server.

Parameters

string $host
int|bool $port
int $tval

Returns

bool —

login()

login(string  $username = '', string  $password = '') : bool

Log in to the POP3 server.

Does not support APOP (RFC 2828, 4949).

Parameters

string $username
string $password

Returns

bool —

disconnect()

disconnect() : mixed

Disconnect from the POP3 server.

Returns

mixed —

getErrors()

getErrors() : array

Get an array of error messages, if any.

Returns

array —

getResponse()

getResponse(int  $size = 128) : string

Get a response from the POP3 server.

Parameters

int $size

The maximum number of bytes to retrieve

Returns

string —

sendString()

sendString(string  $string) : int

Send raw data to the POP3 server.

Parameters

string $string

Returns

int —

checkResponse()

checkResponse(string  $string) : bool

Checks the POP3 server response.

Looks for for +OK or -ERR.

Parameters

string $string

Returns

bool —

setError()

setError(string  $error) : mixed

Add an error to the internal error store.

Also display debug output if it's enabled.

Parameters

string $error

Returns

mixed —

catchWarning()

catchWarning(int  $errno, string  $errstr, string  $errfile, int  $errline) : mixed

POP3 connection error handler.

Parameters

int $errno
string $errstr
string $errfile
int $errline

Returns

mixed —