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

Methods

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

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

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

getBufferParams()

getBufferParams() 

Return an array of params for the Buffer

readGreeting()

readGreeting() 

Read the opening SMTP greeting

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

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