Methods

Class destructor

__destruct() 

Initiates the sending process.

_send() : bool

Returns

boolsuccess boolean

Sends the actual email

_send_email() : bool

Returns

boolsuccess boolean

Performs authentication with the SMTP host

smtp_authenticate() 

Connects to the given smtp and says hello to the other server.

smtp_connect() 

Close SMTP connection

smtp_disconnect() 

Get SMTP response

smtp_get_response() : string

Exceptions

\SmtpTimeoutException

Returns

stringSMTP response

Sends data to the SMTP host

smtp_send(string $data, string | bool | string $expecting, bool $return_number) : mixed

Parameters

$data

string

The SMTP command

$expecting

stringboolstring

The expected response

$return_number

bool

Set to true to return the status number

Exceptions

\SmtpCommandFailureException When the command failed an expecting is not set to false.
\SmtpTimeoutException SMTP connection timed out

Returns

mixedResult or result number, false when expecting is false

 Properties

 

The SMTP connection

$smtp_connection