rcube_smtp

Class to provide SMTP functionality using PEAR Net_SMTP

package

Framework

subpackage

Mail

author

Thomas Bruederli roundcube@gmail.com

author

Aleksander Machniak alec@alec.pl

Methods

Take a set of recipients and parse them, returning an array of bare addresses (forward paths) that can be passed to sendmail or an smtp server with the rcpt to: command.

_parse_rfc822( $recipients) : array

Arguments

$recipients

Response

array

An array of forward paths (bare addresses).

Take an array of mail headers and return a string containing text usable in sending a message.

_prepare_headers(array $headers) : mixed

Arguments

$headers

array

The array of headers to prepare, in an associative array, where the array key is the header name (ie, 'Subject'), and the array value is the header value (ie, 'test'). The header produced from those values would be 'Subject: test'.

Response

mixed

Returns false if it encounters a bad address, otherwise returns an array containing two elements: Any From: address found in the headers, and the plain text version of the headers.

SMTP Connection and authentication

connect( $host = null,  $port = null,  $user = null,  $pass = null) : boolean

Arguments

$host

$port

$user

$pass

Response

boolean

Returns true on success, or false on error

This is our own debug handler for the SMTP connection

debug_handler( &$smtp,  $message) 

Arguments

$smtp

$message

Disconnect the global SMTP connection

disconnect() 

Get error message

get_error() 

Get server response messages array

get_response() 

Reset the global SMTP connection

reset() 

Function for sending mail

send_mail( $from,  $recipients,  &$headers,  &$body,  $opts = null) : boolean

Arguments

$from

$recipients

$headers

$body

$opts

Response

boolean

Returns true on success, or false on error

Constants

SMTP_MIME_CRLF

SMTP_MIME_CRLF

DEBUG_LINE_LENGTH

DEBUG_LINE_LENGTH

Properties

conn

conn : 

Type(s)

response

response : 

Type(s)

error

error : 

Type(s)

anonymize_log

anonymize_log : 

Type(s)