Documentation

Swift_Transport_AbstractSmtpTransport
in package
implements Swift_Transport

Sends Messages over SMTP.

Tags
author

Chris Corbyn

Interfaces, Classes and Traits

Swift_Transport
Sends Messages via an abstract Transport subsystem.

Table of Contents

$addressEncoder  : mixed
$buffer  : mixed
Input-Output buffer for sending/receiving SMTP commands and responses
$domain  : mixed
The domain name to use in HELO command
$eventDispatcher  : mixed
The event dispatching layer
$pipeline  : mixed
The pipelined commands waiting for response
$pipelining  : mixed
Whether the PIPELINING SMTP extension is enabled (RFC 2920)
$sourceIp  : mixed
Source Ip
$started  : mixed
Connection status
__construct()  : mixed
Creates a new EsmtpTransport using the given I/O buffer.
__destruct()  : mixed
Destructor.
executeCommand()  : string|null
Run a command against the buffer, expecting the given response codes.
getAddressEncoder()  : mixed
getBuffer()  : Swift_Transport_IoBuffer
Get the IoBuffer where read/writes are occurring.
getLocalDomain()  : string
Get the name of the domain Swift will identify as.
getSourceIp()  : string
Returns the IP used to connect to the destination.
isStarted()  : bool
Test if an SMTP connection has been established.
ping()  : bool
Check if this Transport mechanism is alive.
registerPlugin()  : mixed
Register a plugin.
reset()  : mixed
Reset the current mail transaction.
send()  : int
Send the given Message.
setAddressEncoder()  : mixed
setLocalDomain()  : $this
Set the name of the local domain which Swift will identify itself as.
setSourceIp()  : mixed
Sets the source IP.
start()  : mixed
Start the SMTP connection.
stop()  : mixed
Stop the SMTP connection.
assertResponseCode()  : mixed
Throws an Exception if a response code is incorrect
doDataCommand()  : mixed
Send the DATA command
doHeloCommand()  : mixed
Send the HELO welcome
doMailFromCommand()  : mixed
Send the MAIL FROM command
doRcptToCommand()  : mixed
Send the RCPT TO command
getBufferParams()  : mixed
Return an array of params for the Buffer
getFullResponse()  : mixed
Get an entire multi-line response using its sequence number
getReversePath()  : mixed
Determine the best-use reverse path for this message
readGreeting()  : mixed
Read the opening SMTP greeting
streamMessage()  : mixed
Stream the contents of the message over the buffer
throwException()  : mixed
Throw a TransportException, first sending it to any listeners
doMailTransaction()  : mixed
Send an email to the given recipients from the given reverse path
sendBcc()  : mixed
Send a message to all Bcc: recipients
sendTo()  : mixed
Send a message to the given To: recipients

Properties

$buffer

Input-Output buffer for sending/receiving SMTP commands and responses

protected mixed $buffer

$pipelining

Whether the PIPELINING SMTP extension is enabled (RFC 2920)

protected mixed $pipelining = ull

Methods

executeCommand()

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

public executeCommand(string $command[, array<string|int, int> $codes = [] ][, array<string|int, string> &$failures = null ][, bool $pipeline = false ][, string $address = null ]) : string|null

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. If the command is RCPT TO, and the pipeline is non-empty, no exception will be thrown; instead the failing address is added to $failures.

Parameters
$command : string
$codes : array<string|int, int> = []
$failures : array<string|int, string> = null

An array of failures by-reference

$pipeline : bool = false

Do not wait for response

$address : string = null

The address, if command is RCPT TO.

Return values
string|null

The server response, or null if pipelining is enabled

getLocalDomain()

Get the name of the domain Swift will identify as.

public getLocalDomain() : string

If an IP address was specified, this will be returned wrapped in square brackets as described in RFC 5321, section 4.1.3.

Return values
string

getSourceIp()

Returns the IP used to connect to the destination.

public getSourceIp() : string
Return values
string

isStarted()

Test if an SMTP connection has been established.

public isStarted() : bool
Return values
bool

ping()

Check if this Transport mechanism is alive.

public ping() : bool
Return values
bool

TRUE if the transport is alive

send()

Send the given Message.

public send(Swift_Mime_SimpleMessage $message[, array<string|int, string> &$failedRecipients = null ]) : int

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

Parameters
$message : Swift_Mime_SimpleMessage
$failedRecipients : array<string|int, string> = null

An array of failures by-reference

Return values
int

setLocalDomain()

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

public setLocalDomain(string $domain) : $this

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

If your server does not have a domain name, use the IP address. This will automatically be wrapped in square brackets as described in RFC 5321, section 4.1.3.

Parameters
$domain : string
Return values
$this

setSourceIp()

Sets the source IP.

public setSourceIp(string $source) : mixed
Parameters
$source : string
Return values
mixed

assertResponseCode()

Throws an Exception if a response code is incorrect

protected assertResponseCode(mixed $response, mixed $wanted) : mixed
Parameters
$response : mixed
$wanted : mixed
Return values
mixed

doDataCommand()

Send the DATA command

protected doDataCommand(mixed &$failedRecipients) : mixed
Parameters
$failedRecipients : mixed
Return values
mixed

doHeloCommand()

Send the HELO welcome

protected doHeloCommand() : mixed
Return values
mixed

doMailFromCommand()

Send the MAIL FROM command

protected doMailFromCommand(mixed $address) : mixed
Parameters
$address : mixed
Return values
mixed

doRcptToCommand()

Send the RCPT TO command

protected doRcptToCommand(mixed $address) : mixed
Parameters
$address : mixed
Return values
mixed

getBufferParams()

Return an array of params for the Buffer

protected abstract getBufferParams() : mixed
Return values
mixed

getFullResponse()

Get an entire multi-line response using its sequence number

protected getFullResponse(mixed $seq) : mixed
Parameters
$seq : mixed
Return values
mixed

readGreeting()

Read the opening SMTP greeting

protected readGreeting() : mixed
Return values
mixed

doMailTransaction()

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

private doMailTransaction(mixed $message, mixed $reversePath, array<string|int, mixed> $recipients, array<string|int, mixed> &$failedRecipients) : mixed
Parameters
$message : mixed
$reversePath : mixed
$recipients : array<string|int, mixed>
$failedRecipients : array<string|int, mixed>
Return values
mixed

sendBcc()

Send a message to all Bcc: recipients

private sendBcc(Swift_Mime_SimpleMessage $message, mixed $reversePath, array<string|int, mixed> $bcc, array<string|int, mixed> &$failedRecipients) : mixed
Parameters
$message : Swift_Mime_SimpleMessage
$reversePath : mixed
$bcc : array<string|int, mixed>
$failedRecipients : array<string|int, mixed>
Return values
mixed

sendTo()

Send a message to the given To: recipients

private sendTo(Swift_Mime_SimpleMessage $message, mixed $reversePath, array<string|int, mixed> $to, array<string|int, mixed> &$failedRecipients) : mixed
Parameters
$message : Swift_Mime_SimpleMessage
$reversePath : mixed
$to : array<string|int, mixed>
$failedRecipients : array<string|int, mixed>
Return values
mixed

Search results