Orig Author: Richard Davey (rich@corephp.co.uk)
Modifications: Andy Prevost
Modifications: Jim Jagielski
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.
Methods
Combination of public events - connect, login, disconnect
Authorise(string $host, integer $port, integer $tval, string $username, string $password, $debug_level)
Parameters
$host
string
$port
integer
$tval
integer
$username
string
$password
string
$debug_level
Connect to the POP3 server
Connect(string $host, integer $port, integer $tval) : boolean
Parameters
$host
string
$port
integer
$tval
integer
Returns
boolean
Disconnect from the POP3 server
Disconnect()
Login to the POP3 server (does not support APOP yet)
Login(string $username, string $password) : boolean
Parameters
$username
string
$password
string
Returns
boolean
Constructor, sets the initial values
__construct() : \POP3
Takes over from PHP for the socket warning handler
catchWarning(integer $errno, string $errstr, string $errfile, integer $errline)
Parameters
$errno
integer
$errstr
string
$errfile
string
$errline
integer
Checks the POP3 server response for +OK or -ERR
checkResponse(string $string) : boolean
Parameters
$string
string
Returns
boolean
If debug is enabled, display the error message array
displayErrors()
Get the socket response back.
getResponse(integer $size) : string
$size is the maximum number of bytes to retrieve
Parameters
$size
integer
Returns
string
Send a string down the open socket connection to the POP3 server
sendString(string $string) : integer
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 Timeout Value
$tval : int
POP3 Username
$username : string