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(string  $host = 'localhost', integer  $port = 25, string  $sec = null, \Pop\Mail\Transport\Smtp\Stream\BufferInterface  $buffer = null, array  $handlers = null) 

Create a new SMTP transport

Parameters

string $host

host

integer $port

port

string $sec

security

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

buffer

array $handlers

handlers

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

setSourceIp()

setSourceIp(string  $source) 

Sets the source IP

Parameters

string $source

getSourceIp()

getSourceIp() : string

Returns the IP used to connect to the destination

Returns

string

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

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

__call()

__call(  $method,   $args) : mixed

Mixin handling method for ESMTP handlers

Parameters

$method
$args

Throws

\Pop\Mail\Transport\Smtp\Exception

Returns

mixed

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

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 message

Parameters

\Pop\Mail\Message $message

Returns

integer

stop()

stop() 

Stop the SMTP connection.

reset()

reset() 

Reset the current mail transaction.

__destruct()

__destruct() 

Destructor

getBufferParams()

getBufferParams() 

Return an array of params for the Buffer

doHeloCommand()

doHeloCommand() 

Send the HELO welcome

doMailFromCommand()

doMailFromCommand(  $address) 

Send the MAIL FROM command

Parameters

$address

doRcptToCommand()

doRcptToCommand(  $address) 

Send the RCPT TO command

Parameters

$address

readGreeting()

readGreeting() 

Read the opening SMTP greeting

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

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

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