class SmtpMailer implements Mailer

Sends emails via the SMTP server.

Constants

EncryptionSSL

EncryptionTLS

Methods

__construct(string $host, string $username, string $password, int|null $port = null, string|null $encryption = null, bool $persistent = false, int $timeout = 20, string|null $clientHost = null, array|null $streamOptions = null)

No description

setSigner(Signer $signer)

No description

void
send(Message $mail)

Sends email.

void
connect()

Connects and authenticates to SMTP server.

void
disconnect()

Disconnects from SMTP server.

void
write(string $line, int|array|null $expectedCode = null, string|null $message = null)

Writes data to server and checks response against expected code if some provided.

string
read()

Reads response from server.

Details

at line 31
__construct(string $host, string $username, string $password, int|null $port = null, string|null $encryption = null, bool $persistent = false, int $timeout = 20, string|null $clientHost = null, array|null $streamOptions = null)

No description

Parameters

string $host
string $username
string $password
int|null $port
string|null $encryption
bool $persistent
int $timeout
string|null $clientHost
array|null $streamOptions

at line 57
SmtpMailer setSigner(Signer $signer)

No description

Parameters

Signer $signer

Return Value

SmtpMailer

at line 68
void send(Message $mail)

Sends email.

Parameters

Message $mail

Return Value

void

Exceptions

SmtpException

at line 123
protected void connect()

Connects and authenticates to SMTP server.

Return Value

void

at line 188
protected void disconnect()

Disconnects from SMTP server.

Return Value

void

at line 199
protected void write(string $line, int|array|null $expectedCode = null, string|null $message = null)

Writes data to server and checks response against expected code if some provided.

Parameters

string $line
int|array|null $expectedCode
string|null $message

Return Value

void

at line 214
protected string read()

Reads response from server.

Return Value

string