\POP3

PHPMailer POP-Before-SMTP Authentication Class.

Specifically for PHPMailer to use for RFC1939 POP-before-SMTP authentication. Does not support APOP.

Summary

Methods
Properties
Constants
popBeforeSmtp()
authorise()
connect()
login()
disconnect()
getErrors()
$Version
$POP3_PORT
$POP3_TIMEOUT
$CRLF
$do_debug
$host
$port
$tval
$username
$password
CRLF
getResponse()
sendString()
checkResponse()
setError()
catchWarning()
$pop_conn
$connected
$errors
N/A
No private methods found
No private properties found
N/A

Constants

CRLF

CRLF = "\r\n"

Line break constant

Properties

$Version

$Version : string

The POP3 PHPMailer Version number.

Type

string

$POP3_PORT

$POP3_PORT : integer

Default POP3 port number.

Type

integer

$POP3_TIMEOUT

$POP3_TIMEOUT : integer

Default timeout in seconds.

Type

integer

$CRLF

$CRLF : string

POP3 Carriage Return + Line Feed.

Type

string

$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(  $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

$host
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.

$size is the maximum number of bytes to retrieve

Parameters

integer $size

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(  $error) 

Add an error to the internal error store.

Also display debug output if it's enabled.

Parameters

$error

catchWarning()

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

POP3 connection error handler.

Parameters

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