\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, and implements 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
getResponse()
sendString()
checkResponse()
setError()
catchWarning()
$pop_conn
$connected
$errors
N/A
No private methods found
No private properties found
N/A

Constants

VERSION

VERSION

The POP3 PHPMailer Version number.

DEFAULT_PORT

DEFAULT_PORT

Default POP3 port number.

DEFAULT_TIMEOUT

DEFAULT_TIMEOUT

Default timeout in seconds.

LE

LE

Line break constant.

Properties

$do_debug

$do_debug : integer

Debug display level.

Options: 0 = no, 1+ = yes.

Type

integer

$host

$host : string

POP3 mail server hostname.

Type

string

$port

$port : integer

POP3 port number.

Type

integer

$tval

$tval : integer

POP3 Timeout Value in seconds.

Type

integer

$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 : boolean

Are we connected?

Type

boolean

$errors

$errors : array

Error container.

Type

array

Methods

popBeforeSmtp()

popBeforeSmtp(string  $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.

Parameters

string $host

The hostname to connect to

integer|boolean $port

The port number to connect to

integer|boolean $timeout

The timeout value

string $username
string $password
integer $debug_level

Returns

boolean

authorise()

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

Authenticate with a POP3 server.

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

Parameters

string $host

The hostname to connect to

integer|boolean $port

The port number to connect to

integer|boolean $timeout

The timeout value

string $username
string $password
integer $debug_level

Returns

boolean

connect()

connect(string  $host, integer|boolean  $port = false, integer  $tval = 30) : boolean

Connect to a POP3 server.

Parameters

string $host
integer|boolean $port
integer $tval

Returns

boolean

login()

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

Log in to the POP3 server.

Does not support APOP (RFC 2828, 4949).

Parameters

string $username
string $password

Returns

boolean

disconnect()

disconnect() 

Disconnect from the POP3 server.

getErrors()

getErrors() : array

Get an array of error messages, if any.

Returns

array

getResponse()

getResponse(integer  $size = 128) : string

Get a response from the POP3 server.

Parameters

integer $size

The maximum number of bytes to retrieve

Returns

string

sendString()

sendString(string  $string) : integer

Send raw data to the POP3 server.

Parameters

string $string

Returns

integer

checkResponse()

checkResponse(string  $string) : boolean

Checks the POP3 server response.

Looks for for +OK or -ERR.

Parameters

string $string

Returns

boolean

setError()

setError(string  $error) 

Add an error to the internal error store.

Also display debug output if it's enabled.

Parameters

string $error

catchWarning()

catchWarning(integer  $errno, string  $errstr, string  $errfile, integer  $errline) 

POP3 connection error handler.

Parameters

integer $errno
string $errstr
string $errfile
integer $errline