PHP POP-Before-SMTP Authentication Class

Version 5.2.4

license : LGPL, see PHPMailer License Specifically for PHPMailer to allow POP before SMTP authentication. Does not yet work with APOP - if you have an APOP account, contact Jim Jagielski and we can test changes to this script. This class is based on the structure of the SMTP class originally authored by Chris Ryan This class is rfc 1939 compliant and implements all the commands required for POP3 connection, authentication and disconnection.
package PHPMailer
author Richard Davey (orig)
author Andy Prevost
author Jim Jagielski

 Methods

Combination of public events - connect, login, disconnect

Authorise(string $host, bool | int $port, bool | int $tval, string $username, string $password, int $debug_level) : bool

access public

Parameters

$host

string

$port

boolint

$tval

boolint

$username

string

$password

string

$debug_level

int

Returns

bool

Connect to the POP3 server

Connect(string $host, bool | int $port, integer $tval) : boolean

access public

Parameters

$host

string

$port

boolint

$tval

integer

Returns

boolean

Disconnect from the POP3 server

Disconnect() 

access public

Constructor, sets the initial values

__construct() : \POP3

access public

Returns

Takes over from PHP for the socket warning handler

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

access private

Parameters

$errno

integer

$errstr

string

$errfile

string

$errline

integer

Checks the POP3 server response for +OK or -ERR

checkResponse(string $string) : boolean

access private

Parameters

$string

string

Returns

boolean

If debug is enabled, display the error message array

displayErrors() 

access private

Get the socket response back.

getResponse(integer $size) : string

$size is the maximum number of bytes to retrieve

access private

Parameters

$size

integer

Returns

string

Send a string down the open socket connection to the POP3 server

sendString(string $string) : integer

access private

Parameters

$string

string

Returns

integer

 Properties

 

POP3 Carriage Return + Line Feed

$CRLF : string

 

Default POP3 port

$POP3_PORT : int

 

Default Timeout

$POP3_TIMEOUT : int

 

Sets the POP3 PHPMailer Version number

$Version : string

 

Displaying Debug warnings? (0 = now, 1+ = yes)

$do_debug : int

 

POP3 Mail Server

$host : string

 

POP3 Password

$password : string

 

POP3 Port

$port : int

 

POP3 Timeout Value

$tval : int

 

POP3 Username

$username : string

 

<p>Are we connected?</p>

$connected : boolean

 

<p>Error container</p>

$error : array

 

<p>Resource handle for the POP connection socket</p>

$pop_conn : resource