Sends Messages over SMTP with ESMTP support.

package Swift
subpackage Transport
author Chris Corbyn

 Methods

Mixin handling method for ESMTP handlers

__call($method, $args) 

Parameters

$method

$args

Creates a new EsmtpTransport using the given I/O buffer.

__construct(\Swift_Transport_IoBuffer $buf, array $extensionHandlers, \Swift_Events_EventDispatcher $dispatcher) 

Destructor.

__destruct() 
Inherited
inherited_from \Swift_Transport_AbstractSmtpTransport::__destruct()

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

executeCommand(string $command, int[] $codes, string[] $failures) : string

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

$command

string

$codes

int[]

$failures

string[]

&$failures

Returns

string

Get the IoBuffer where read/writes are occurring.

getBuffer() : \Swift_Transport_IoBuffer
Inherited
inherited_from \Swift_Transport_SmtpAgent::getBuffer()

Returns

Get the encryption type.

getEncryption() : string

Returns

string

Get ESMTP extension handlers.

getExtensionHandlers() : \Swift_Transport_EsmtpHandler[]

Get the host to connect to.

getHost() : string

Returns

string

Get the name of the domain Swift will identify as.

getLocalDomain() : string
Inherited
inherited_from \Swift_Transport_AbstractSmtpTransport::getLocalDomain()

Returns

string

Get the port to connect to.

getPort() : int

Returns

int

Returns the ip used to connect to the destination

getSourceIp() : string

Returns

string

Get the connection timeout.

getTimeout() : int

Returns

int

Test if an SMTP connection has been established.

isStarted() : boolean
Inherited
inherited_from \Swift_Transport_AbstractSmtpTransport::isStarted()

Returns

boolean

Register a plugin.

registerPlugin(\Swift_Events_EventListener $plugin) 
Inherited
inherited_from \Swift_Transport_AbstractSmtpTransport::registerPlugin()

Parameters

Reset the current mail transaction.

reset() 
Inherited
inherited_from \Swift_Transport_AbstractSmtpTransport::reset()

Send the given Message.

send(\Swift_Mime_Message $message, string[] $failedRecipients) : int
Inherited

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

inherited_from \Swift_Transport_AbstractSmtpTransport::send()

Parameters

$failedRecipients

string[]

&$failedRecipients to collect failures by-reference

Returns

int

Set the encryption type (tls or ssl)

setEncryption($enc) : \Swift_Transport_EsmtpTransport

Parameters

$enc

Returns

Set ESMTP extension handlers.

setExtensionHandlers(array $handlers) : \Swift_Transport_EsmtpTransport

Set the host to connect to.

setHost(string $host) : \Swift_Transport_EsmtpTransport

Parameters

$host

string

Returns

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

setLocalDomain(string $domain) : \Swift_Transport_AbstractSmtpTransport
Inherited

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]).

inherited_from \Swift_Transport_AbstractSmtpTransport::setLocalDomain()

Parameters

$domain

string

Returns

Set the port to connect to.

setPort(int $port) : \Swift_Transport_EsmtpTransport

Parameters

$port

int

Returns

Sets the sourceIp

setSourceIp(string $source) : \Swift_Transport_EsmtpTransport

Parameters

$source

string

Returns

Set the connection timeout.

setTimeout(int $timeout) : \Swift_Transport_EsmtpTransport

Parameters

$timeout

int

seconds

Returns

Start the SMTP connection.

start() 
Inherited
inherited_from \Swift_Transport_AbstractSmtpTransport::start()

Stop the SMTP connection.

stop() 
Inherited
inherited_from \Swift_Transport_AbstractSmtpTransport::stop()

Throws an Exception if a response code is incorrect

_assertResponseCode($response, $wanted) 
Inherited
inherited_from \Swift_Transport_AbstractSmtpTransport::_assertResponseCode()

Parameters

$response

$wanted

Send the DATA command

_doDataCommand() 
Inherited
inherited_from \Swift_Transport_AbstractSmtpTransport::_doDataCommand()

Overridden to perform EHLO instead

_doHeloCommand() 

Overridden to add Extension support

_doMailFromCommand($address) 

Parameters

$address

Overridden to add Extension support

_doRcptToCommand($address) 

Parameters

$address

Get the params to initialize the buffer

_getBufferParams() 

Get an entire multi-line response using its sequence number

_getFullResponse($seq) 
Inherited
inherited_from \Swift_Transport_AbstractSmtpTransport::_getFullResponse()

Parameters

$seq

Determine the best-use reverse path for this message

_getReversePath(\Swift_Mime_Message $message) 
Inherited
inherited_from \Swift_Transport_AbstractSmtpTransport::_getReversePath()

Parameters

$message

Read the opening SMTP greeting

_readGreeting() 
Inherited
inherited_from \Swift_Transport_AbstractSmtpTransport::_readGreeting()

Stream the contents of the message over the buffer

_streamMessage(\Swift_Mime_Message $message) 
Inherited
inherited_from \Swift_Transport_AbstractSmtpTransport::_streamMessage()

Parameters

$message

Throw a TransportException, first sending it to any listeners

_throwException(\Swift_TransportException $e) 
Inherited
inherited_from \Swift_Transport_AbstractSmtpTransport::_throwException()

Parameters

$e

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

_doMailTransaction($message, $reversePath, array $recipients, array $failedRecipients) 
Inherited
inherited_from \Swift_Transport_AbstractSmtpTransport::_doMailTransaction()

Parameters

$message

$reversePath

$recipients

$failedRecipients

Get ESMTP handlers which are currently ok to use

_getActiveHandlers() 

Determine ESMTP capabilities by function group

_getCapabilities($ehloResponse) 

Parameters

$ehloResponse

Determine is the $hostname is a fully-qualified name

_isFqdn($hostname) 
Inherited
inherited_from \Swift_Transport_AbstractSmtpTransport::_isFqdn()

Parameters

$hostname

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

_lookupHostname() 
Inherited
inherited_from \Swift_Transport_AbstractSmtpTransport::_lookupHostname()

Send a message to all Bcc: recipients

_sendBcc(\Swift_Mime_Message $message, $reversePath, array $bcc, array $failedRecipients) 
Inherited
inherited_from \Swift_Transport_AbstractSmtpTransport::_sendBcc()

Parameters

$message

$reversePath

$bcc

$failedRecipients

Send a message to the given Cc: recipients

_sendCc(\Swift_Mime_Message $message, $reversePath, array $cc, array $failedRecipients) 
Inherited
inherited_from \Swift_Transport_AbstractSmtpTransport::_sendCc()

Parameters

$message

$reversePath

$cc

$failedRecipients

Send a message to the given To: recipients

_sendTo(\Swift_Mime_Message $message, $reversePath, array $to, array $failedRecipients) 
Inherited
inherited_from \Swift_Transport_AbstractSmtpTransport::_sendTo()

Parameters

$message

$reversePath

$to

$failedRecipients

Set parameters which are used by each extension handler

_setHandlerParams() 

Custom sort for extension handler ordering

_sortHandlers($a, $b) 

Parameters

$a

$b

 Properties

 

$_buffer 
Inherited
inherited_from \Swift_Transport_AbstractSmtpTransport::$$_buffer
 

$_domain 
Inherited
inherited_from \Swift_Transport_AbstractSmtpTransport::$$_domain
 

$_eventDispatcher 
Inherited
inherited_from \Swift_Transport_AbstractSmtpTransport::$$_eventDispatcher
 

$_sourceIp 
Inherited
inherited_from \Swift_Transport_AbstractSmtpTransport::$$_sourceIp
 

$_started 
Inherited
inherited_from \Swift_Transport_AbstractSmtpTransport::$$_started
 

$_capabilities : string[]
access private
 

$_handlers : \Swift_Transport_EsmtpHandler[]
access private
 

$_params : array
access protected