Properties

$started

$started : boolean

Connection status

Type

boolean

$domain

$domain : string

The domain name to use in HELO command

Type

string

$sourceIp

$sourceIp : string

Source IP

Type

string

$handlers

$handlers : array

ESMTP extension handlers

Type

array

$capabilities

$capabilities : array

ESMTP capabilities

Type

array

$params

$params : array

Connection buffer parameters

Type

array

Methods

__construct()

__construct(\Pop\Mail\Transport\Smtp\Stream\BufferInterface  $buffer = null, array  $handlers = null) 

Creates a new EsmtpTransport using the given I/O buffer

Parameters

\Pop\Mail\Transport\Smtp\Stream\BufferInterface $buffer
array $handlers

setLocalDomain()

setLocalDomain(string  $domain) : \Pop\Mail\Transport\Smtp\AbstractSmtp

Set the name of the local domain which Swift will identify itself as.

This should be a fully-qualified domain name and should be truly the domain you're using.

If your server doesn't have a domain name, use the IP in square brackets (i.e. [127.0.0.1]).

Parameters

string $domain

Returns

\Pop\Mail\Transport\Smtp\AbstractSmtp

getLocalDomain()

getLocalDomain() : string

Get the name of the domain Swift will identify as

Returns

string

getSourceIp()

getSourceIp() : string

Returns the IP used to connect to the destination

Returns

string

start()

start() 

Start the SMTP connection

isStarted()

isStarted() : boolean

Test if an SMTP connection has been established

Returns

boolean

send()

send(\Pop\Mail\Message  $message) : integer

Send the given Message.

Recipient/sender data will be retrieved from the Message API. The return value is the number of recipients who were accepted for delivery.

Parameters

\Pop\Mail\Message $message

Throws

\Exception

Returns

integer

stop()

stop() 

Stop the SMTP connection.

reset()

reset() 

Reset the current mail transaction.

executeCommand()

executeCommand(string  $command, array<mixed,integer>  $codes = array()) : string

Run a command against the buffer, expecting the given response codes.

If no response codes are given, the response will not be validated. If codes are given, an exception will be thrown on an invalid response.

Parameters

string $command
array<mixed,integer> $codes

Returns

string

__destruct()

__destruct() 

Destructor

getHost()

getHost() : string

Get the host to connect to

Returns

string

getPort()

getPort() : integer

Get the port to connect to

Returns

integer

setTimeout()

setTimeout(integer  $timeout) : \Pop\Mail\Transport\Smtp\EsmtpTransport

Set the connection timeout

Parameters

integer $timeout

seconds

Returns

\Pop\Mail\Transport\Smtp\EsmtpTransport

getTimeout()

getTimeout() : integer

Get the connection timeout

Returns

integer

setEncryption()

setEncryption(string  $encryption) : \Pop\Mail\Transport\Smtp\EsmtpTransport

Set the encryption type (tls or ssl)

Parameters

string $encryption

Returns

\Pop\Mail\Transport\Smtp\EsmtpTransport

getEncryption()

getEncryption() : string

Get the encryption type

Returns

string

setStreamOptions()

setStreamOptions(array  $options) : \Pop\Mail\Transport\Smtp\EsmtpTransport

Sets the stream context options

Parameters

array $options

Returns

\Pop\Mail\Transport\Smtp\EsmtpTransport

getStreamOptions()

getStreamOptions() : array

Returns the stream context options

Returns

array

setExtensionHandlers()

setExtensionHandlers(array  $handlers) : \Pop\Mail\Transport\Smtp\EsmtpTransport

Set ESMTP extension handlers

Parameters

array $handlers

Returns

\Pop\Mail\Transport\Smtp\EsmtpTransport

getExtensionHandlers()

getExtensionHandlers() : array

Get ESMTP extension handlers

Returns

array

__call()

__call(  $method,   $args) : mixed

Mixin handling method for ESMTP handlers

Parameters

$method
$args

Throws

\Pop\Mail\Transport\Smtp\Exception

Returns

mixed

getBufferParams()

getBufferParams() : array

Get the params to initialize the buffer

Returns

array

readGreeting()

readGreeting() 

Read the opening SMTP greeting

doHeloCommand()

doHeloCommand() : mixed

Overridden to perform EHLO instead

Returns

mixed

doMailFromCommand()

doMailFromCommand(string  $address) 

Overridden to add Extension support

Parameters

string $address

doRcptToCommand()

doRcptToCommand(string  $address) 

Overridden to add Extension support

Parameters

string $address

doDataCommand()

doDataCommand() 

Send the DATA command

streamMessage()

streamMessage(\Pop\Mail\Message  $message) 

Stream the contents of the message over the buffer

Parameters

\Pop\Mail\Message $message

getReversePath()

getReversePath(\Pop\Mail\Message  $message) : null|string

Determine the best-use reverse path for this message

Parameters

\Pop\Mail\Message $message

Returns

null|string

throwException()

throwException(\Pop\Mail\Transport\Smtp\Exception  $e) 

Throw a TransportException, first sending it to any listeners

Parameters

\Pop\Mail\Transport\Smtp\Exception $e

Throws

\Pop\Mail\Transport\Smtp\Exception

assertResponseCode()

assertResponseCode(string  $response, string  $wanted) 

Throws an Exception if a response code is incorrect

Parameters

string $response
string $wanted

getFullResponse()

getFullResponse(string  $seq) : string

Get an entire multi-line response using its sequence number

Parameters

string $seq

Returns

string

doMailTransaction()

doMailTransaction(\Pop\Mail\Message  $message, string  $reversePath, array  $recipients) : integer

Send an email to the given recipients from the given reverse path

Parameters

\Pop\Mail\Message $message
string $reversePath
array $recipients

Returns

integer

sendTo()

sendTo(\Pop\Mail\Message  $message, string  $reversePath, array  $to) : integer

Send a message to the given To: recipients

Parameters

\Pop\Mail\Message $message
string $reversePath
array $to

Returns

integer

sendBcc()

sendBcc(\Pop\Mail\Message  $message, string  $reversePath, array  $bcc) : integer

Send a message to all Bcc: recipients

Parameters

\Pop\Mail\Message $message
string $reversePath
array $bcc

Returns

integer

lookupHostname()

lookupHostname() 

Try to determine the hostname of the server this is run on

isFqdn()

isFqdn(string  $hostname) : boolean

Determine is the $hostname is a fully-qualified name

Parameters

string $hostname

Returns

boolean

getCapabilities()

getCapabilities(string  $ehloResponse) : array

Determine ESMTP capabilities by function group

Parameters

string $ehloResponse

Returns

array

setHandlerParams()

setHandlerParams() 

Set parameters which are used by each extension handler

getActiveHandlers()

getActiveHandlers() 

Get ESMTP handlers which are currently ok to use