Abstract Class Swift_Transport_AbstractSmtpTransport

InheritanceSwift_Transport_AbstractSmtpTransport
ImplementsSwift_Transport
SubclassesSwift_SendmailTransport, Swift_SmtpTransport, Swift_Transport_EsmtpTransport, Swift_Transport_SendmailTransport

Sends Messages over SMTP.

Protected Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$_buffer Input-Output buffer for sending/receiving SMTP commands and responses Swift_Transport_AbstractSmtpTransport
$_domain The domain name to use in HELO command Swift_Transport_AbstractSmtpTransport
$_eventDispatcher The event dispatching layer Swift_Transport_AbstractSmtpTransport
$_sourceIp Source Ip Swift_Transport_AbstractSmtpTransport
$_started Connection status Swift_Transport_AbstractSmtpTransport

Public Methods

Hide inherited methods

MethodDescriptionDefined By
__construct() Creates a new EsmtpTransport using the given I/O buffer. Swift_Transport_AbstractSmtpTransport
__destruct() Destructor. Swift_Transport_AbstractSmtpTransport
executeCommand() Run a command against the buffer, expecting the given response codes. Swift_Transport_AbstractSmtpTransport
getBuffer() Get the IoBuffer where read/writes are occurring. Swift_Transport_AbstractSmtpTransport
getLocalDomain() Get the name of the domain Swift will identify as. Swift_Transport_AbstractSmtpTransport
getSourceIp() Returns the IP used to connect to the destination. Swift_Transport_AbstractSmtpTransport
isStarted() Test if an SMTP connection has been established. Swift_Transport_AbstractSmtpTransport
registerPlugin() Register a plugin. Swift_Transport_AbstractSmtpTransport
reset() Reset the current mail transaction. Swift_Transport_AbstractSmtpTransport
send() Send the given Message. Swift_Transport_AbstractSmtpTransport
setLocalDomain() Set the name of the local domain which Swift will identify itself as. Swift_Transport_AbstractSmtpTransport
setSourceIp() Sets the source IP. Swift_Transport_AbstractSmtpTransport
start() Start the SMTP connection. Swift_Transport_AbstractSmtpTransport
stop() Stop the SMTP connection. Swift_Transport_AbstractSmtpTransport

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
_assertResponseCode() Throws an Exception if a response code is incorrect Swift_Transport_AbstractSmtpTransport
_doDataCommand() Send the DATA command Swift_Transport_AbstractSmtpTransport
_doHeloCommand() Send the HELO welcome Swift_Transport_AbstractSmtpTransport
_doMailFromCommand() Send the MAIL FROM command Swift_Transport_AbstractSmtpTransport
_doRcptToCommand() Send the RCPT TO command Swift_Transport_AbstractSmtpTransport
_getBufferParams() Return an array of params for the Buffer Swift_Transport_AbstractSmtpTransport
_getFullResponse() Get an entire multi-line response using its sequence number Swift_Transport_AbstractSmtpTransport
_getReversePath() Determine the best-use reverse path for this message Swift_Transport_AbstractSmtpTransport
_readGreeting() Read the opening SMTP greeting Swift_Transport_AbstractSmtpTransport
_streamMessage() Stream the contents of the message over the buffer Swift_Transport_AbstractSmtpTransport
_throwException() Throw a TransportException, first sending it to any listeners Swift_Transport_AbstractSmtpTransport

Property Details

$_buffer protected property
protected $_buffer null
$_domain protected property
protected $_domain '[127.0.0.1]'
$_eventDispatcher protected property
protected $_eventDispatcher null
$_sourceIp protected property
protected $_sourceIp null
$_started protected property
protected $_started false

Method Details

__construct() public method

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

public void __construct ( Swift_Transport_IoBuffer $buf, Swift_Events_EventDispatcher $dispatcher )
$buf Swift_Transport_IoBuffer
$dispatcher Swift_Events_EventDispatcher
__destruct() public method

Destructor.

public void __destruct ( )
_assertResponseCode() protected method

Throws an Exception if a response code is incorrect

protected void _assertResponseCode ( $response, $wanted )
$response
$wanted
_doDataCommand() protected method

Send the DATA command

protected void _doDataCommand ( )
_doHeloCommand() protected method

Send the HELO welcome

protected void _doHeloCommand ( )
_doMailFromCommand() protected method

Send the MAIL FROM command

protected void _doMailFromCommand ( $address )
$address
_doRcptToCommand() protected method

Send the RCPT TO command

protected void _doRcptToCommand ( $address )
$address
_getBufferParams() protected abstract method

Return an array of params for the Buffer

protected abstract void _getBufferParams ( )
_getFullResponse() protected method

Get an entire multi-line response using its sequence number

protected void _getFullResponse ( $seq )
$seq
_getReversePath() protected method

Determine the best-use reverse path for this message

protected void _getReversePath ( Swift_Mime_Message $message )
$message
_readGreeting() protected method

Read the opening SMTP greeting

protected void _readGreeting ( )
_streamMessage() protected method

Stream the contents of the message over the buffer

protected void _streamMessage ( Swift_Mime_Message $message )
$message
_throwException() protected method

Throw a TransportException, first sending it to any listeners

protected void _throwException ( Swift_TransportException $e )
$e
executeCommand() public method

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.

public string executeCommand ( $command, $codes = [], &$failures null )
$command string
$codes int
$failures string[]

An array of failures by-reference

getBuffer() public method

Get the IoBuffer where read/writes are occurring.

public Swift_Transport_IoBuffer getBuffer ( )
getLocalDomain() public method

Get the name of the domain Swift will identify as.

public string getLocalDomain ( )
getSourceIp() public method

Returns the IP used to connect to the destination.

public string getSourceIp ( )
isStarted() public method

Test if an SMTP connection has been established.

public bool isStarted ( )
registerPlugin() public method

Register a plugin.

public void registerPlugin ( Swift_Events_EventListener $plugin )
$plugin Swift_Events_EventListener
reset() public method

Reset the current mail transaction.

public void reset ( )
send() public method

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.

public int send ( Swift_Mime_Message $message, &$failedRecipients null )
$message Swift_Mime_Message
$failedRecipients string[]

An array of failures by-reference

setLocalDomain() public method

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

public Swift_Transport_AbstractSmtpTransport setLocalDomain ( $domain )
$domain string
setSourceIp() public method

Sets the source IP.

public void setSourceIp ( $source )
$source string
start() public method

Start the SMTP connection.

public void start ( )
stop() public method

Stop the SMTP connection.

public void stop ( )