PHP Class Swift_Transport_EsmtpTransport

Author: Chris Corbyn
Inheritance: extends Swift_Transport_AbstractSmtpTransport, implements Swift_Transport_SmtpAgent
Mostra file Open project: swiftmailer/swiftmailer Class Usage Examples

Public Methods

Method Description
__call ( $method, $args ) Mixin handling method for ESMTP handlers
__construct ( Swift_Transport_IoBuffer $buf, array $extensionHandlers, Swift_Events_EventDispatcher $dispatcher ) Creates a new EsmtpTransport using the given I/O buffer.
executeCommand ( string $command, int[] $codes = [], string[] &$failures = null ) : string Run a command against the buffer, expecting the given response codes.
getEncryption ( ) : string Get the encryption type.
getExtensionHandlers ( ) : Swift_Transport_EsmtpHandler[] Get ESMTP extension handlers.
getHost ( ) : string Get the host to connect to.
getPort ( ) : integer Get the port to connect to.
getSourceIp ( ) : string Returns the IP used to connect to the destination.
getStreamOptions ( ) : array Returns the stream context options.
getTimeout ( ) : integer Get the connection timeout.
setEncryption ( string $encryption ) : Swift_Transport_EsmtpTransport Set the encryption type (tls or ssl).
setExtensionHandlers ( array $handlers ) : Swift_Transport_EsmtpTransport Set ESMTP extension handlers.
setHost ( string $host ) : Swift_Transport_EsmtpTransport Set the host to connect to.
setPort ( integer $port ) : Swift_Transport_EsmtpTransport Set the port to connect to.
setSourceIp ( string $source ) : Swift_Transport_EsmtpTransport Sets the source IP.
setStreamOptions ( array $options ) : Swift_Transport_EsmtpTransport Sets the stream context options.
setTimeout ( integer $timeout ) : Swift_Transport_EsmtpTransport Set the connection timeout.

Protected Methods

Method Description
doHeloCommand ( ) Overridden to perform EHLO instead
doMailFromCommand ( $address ) Overridden to add Extension support
doRcptToCommand ( $address ) Overridden to add Extension support
getBufferParams ( ) Get the params to initialize the buffer

Private Methods

Method Description
getActiveHandlers ( ) Get ESMTP handlers which are currently ok to use
getCapabilities ( $ehloResponse ) Determine ESMTP capabilities by function group
setHandlerParams ( ) Set parameters which are used by each extension handler

Method Details

__call() public method

Mixin handling method for ESMTP handlers
public __call ( $method, $args )

__construct() public method

Creates a new EsmtpTransport using the given I/O buffer.
public __construct ( Swift_Transport_IoBuffer $buf, array $extensionHandlers, Swift_Events_EventDispatcher $dispatcher )
$buf Swift_Transport_IoBuffer
$extensionHandlers array
$dispatcher Swift_Events_EventDispatcher

doHeloCommand() protected method

Overridden to perform EHLO instead
protected doHeloCommand ( )

doMailFromCommand() protected method

Overridden to add Extension support
protected doMailFromCommand ( $address )

doRcptToCommand() protected method

Overridden to add Extension support
protected doRcptToCommand ( $address )

executeCommand() public method

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 executeCommand ( string $command, int[] $codes = [], string[] &$failures = null ) : string
$command string
$codes int[]
$failures string[] An array of failures by-reference
return string

getBufferParams() protected method

Get the params to initialize the buffer
protected getBufferParams ( )

getEncryption() public method

Get the encryption type.
public getEncryption ( ) : string
return string

getExtensionHandlers() public method

Get ESMTP extension handlers.
public getExtensionHandlers ( ) : Swift_Transport_EsmtpHandler[]
return Swift_Transport_EsmtpHandler[]

getHost() public method

Get the host to connect to.
public getHost ( ) : string
return string

getPort() public method

Get the port to connect to.
public getPort ( ) : integer
return integer

getSourceIp() public method

Returns the IP used to connect to the destination.
public getSourceIp ( ) : string
return string

getStreamOptions() public method

Returns the stream context options.
public getStreamOptions ( ) : array
return array

getTimeout() public method

Get the connection timeout.
public getTimeout ( ) : integer
return integer

setEncryption() public method

Set the encryption type (tls or ssl).
public setEncryption ( string $encryption ) : Swift_Transport_EsmtpTransport
$encryption string
return Swift_Transport_EsmtpTransport

setExtensionHandlers() public method

Set ESMTP extension handlers.
public setExtensionHandlers ( array $handlers ) : Swift_Transport_EsmtpTransport
$handlers array
return Swift_Transport_EsmtpTransport

setHost() public method

Set the host to connect to.
public setHost ( string $host ) : Swift_Transport_EsmtpTransport
$host string
return Swift_Transport_EsmtpTransport

setPort() public method

Set the port to connect to.
public setPort ( integer $port ) : Swift_Transport_EsmtpTransport
$port integer
return Swift_Transport_EsmtpTransport

setSourceIp() public method

Sets the source IP.
public setSourceIp ( string $source ) : Swift_Transport_EsmtpTransport
$source string
return Swift_Transport_EsmtpTransport

setStreamOptions() public method

Sets the stream context options.
public setStreamOptions ( array $options ) : Swift_Transport_EsmtpTransport
$options array
return Swift_Transport_EsmtpTransport

setTimeout() public method

Set the connection timeout.
public setTimeout ( integer $timeout ) : Swift_Transport_EsmtpTransport
$timeout integer seconds
return Swift_Transport_EsmtpTransport