@return: {VOID}
@param: {STRING} $cafile: Relative Path to a SSL Certificate Authority File (Ex: store within smart-framework/etc/certificates ; specify as 'etc/certificates/ca.pem') ; IMPORTANT: in this case the 'etc/certificates/' directory must be protected with a .htaccess to avoid being public readable - the directory and any files within this directory ...)
Set a SSL/TLS Certificate Authority File
If not set but SMART_FRAMEWORK_SSL_CA_FILE is defined will use the SMART_FRAMEWORK_SSL_CA_FILE
@return: {INTEGER+} 1 on success, 0 on fail
@param: {STRING} $server: The Server Hostname or IP address
@param: {INTEGER+} $port: *Optional* The Server Port ; Default is: 110
@param: {ENUM} $sslversion: To connect using SSL mode this must be set to any of these accepted values: '', 'starttls', 'starttls:1.0', 'starttls:1.1', 'starttls:1.2', 'tls', 'tls:1.0', 'tls:1.1', 'tls:1.2', 'ssl', 'sslv3' ; If empty string is set here it will be operate in unsecure mode (NOT using any SSL/TLS Mode)
Will try to open a socket to the specified POP3 Server using the host/ip and port ; If a SSL option is selected will try to establish a SSL socket or fail
publicfunctionnoop (
) {} -> INTEGER+
@return: {INTEGER+} 1 on Success or 0 on Error
Ping the POP3 Server
Sends the command NOOP to the Server
publicfunctionreset (
) {} -> INTEGER+
@return: {INTEGER+} 1 on Success or 0 on Error
Reset the POP3 server connection (includding all messages marked to be deleted)
publicfunctionquit (
) {} -> INTEGER+
@return: {INTEGER+} 1 on Success or 0 on Error
Sends the QUIT/LOGOUT commands set to the POP3 server
Closes the communication socket after sending LOGOUT command
@return: {INTEGER+} 1 on Success or 0 on Failure or Error
@param: {STRING} $username: The authentication username
@param: {STRING} $pass: The authentication password
@param: {ENUM} $mode: *Optional* The authentication mode ; can be set to any of: 'login', 'apop', 'auth:cram-md5' ; Default is 'login'
Try to Authenticate on the POP3 Server with a username and password
Sends both user and pass to the Server
publicfunctioncount (
) {} -> ARRAY
@return: {ARRAY} Which contains the following keys [ 'size' => 1024, 'count' => 101 ]
Get The Count Information for the selected account MailBox
@return: {STRING} A unique UID or a list with multiple (ar all) UIDs ; returns empty string on error
@param: {STRING} $msg_num: *Optional* A specific Message Number for a specific message or leave empty to get the list with all UIDs (all message numbers on the server)
Get the list of UIDs or a specific UID for the selected message
@hints: Some servers may not comply with this method and may return empty result
@return: {STRING} the size of the selected message (ussualy in Bytes) or empty string if Error
@param: {STRING} $msg_num: The Message Number
@return: {STRING} The first lines of the message body or empty string on ERROR
@param: {STRING} $msg_num: The Message Number
@param: {INTEGER+} $read_lines: The number of lines to retrieve 1..255
Get the Message Head Lines (first lines of the message body)
@return: {STRING} The full message containing the Message Headers and Body as stored on the server or empty string on ERROR
@param: {STRING} $msg_num: The Message Number
Get the Entire Message from Server
class Properties
public$buffer = 512 ; ->INT
socket read buffer
public$timeout = 30 ; ->INT
socket timeout in seconds
public$debug = FALSE ; ->BOOLEAN
debug on/off
public$error = '' ; ->STRING
This should be checked after each operation on the server
The error message(s) will be collected here
do not SET a value here, but just GET the result
public$log = '' ; ->STRING
The operations log (only if debug is enabled)
Do not SET a value here, but just GET the result
class Constants
documentation generated on: 2023-10-19 23:15:46 +0000