SendmailTransport for sending mail through a sendmail/postfix (etc.

.) binary.

package Swift
subpackage Transport
author Chris Corbyn

 Methods

Create a new SendmailTransport, optionally using $command for sending.

__construct(string $command) 

Parameters

$command

string

Destructor.

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

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

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

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.

inherited_from \Swift_Transport_AbstractSmtpTransport::executeCommand()
inherited_from \Swift_Transport_SendmailTransport::executeCommand()

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_AbstractSmtpTransport::getBuffer()
inherited_from \Swift_Transport_SendmailTransport::getBuffer()

Returns

Get the sendmail command which will be invoked.

getCommand() : string
Inherited
inherited_from \Swift_Transport_SendmailTransport::getCommand()

Returns

string

Get the name of the domain Swift will identify as.

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

Returns

string

Returns the ip used to connect to the destination

getSourceIp() : string
Inherited
inherited_from \Swift_Transport_AbstractSmtpTransport::getSourceIp()
inherited_from \Swift_Transport_SendmailTransport::getSourceIp()

Returns

string

Test if an SMTP connection has been established.

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

Returns

boolean

Create a new SendmailTransport instance.

newInstance(string $command) : \Swift_SendmailTransport
Static

Parameters

$command

string

Returns

Register a plugin.

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

Parameters

Reset the current mail transaction.

reset() 
Inherited
inherited_from \Swift_Transport_AbstractSmtpTransport::reset()
inherited_from \Swift_Transport_SendmailTransport::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. NOTE: If using 'sendmail -t' you will not be aware of any failures until they bounce (i.e. send() will always return 100% success).

inherited_from \Swift_Transport_SendmailTransport::send()

Parameters

$failedRecipients

string[]

&$failedRecipients to collect failures by-reference

Returns

int

Set the command to invoke.

setCommand(string $command) : \Swift_Transport_SendmailTransport
Inherited

If using -t mode you are strongly advised to include -oi or -i in the flags. For example: /usr/sbin/sendmail -oi -t Swift will append a -f flag if one is not present. The recommended mode is "-bs" since it is interactive and failure notifications are hence possible.

inherited_from \Swift_Transport_SendmailTransport::setCommand()

Parameters

$command

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()
inherited_from \Swift_Transport_SendmailTransport::setLocalDomain()

Parameters

$domain

string

Returns

Sets the sourceIp

setSourceIp(string $source) 
Inherited
inherited_from \Swift_Transport_AbstractSmtpTransport::setSourceIp()
inherited_from \Swift_Transport_SendmailTransport::setSourceIp()

Parameters

$source

string

Start the standalone SMTP session if running in -bs mode.

start() 
Inherited
inherited_from \Swift_Transport_SendmailTransport::start()

Stop the SMTP connection.

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

Throws an Exception if a response code is incorrect

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

Parameters

$response

$wanted

Send the DATA command

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

Send the HELO welcome

_doHeloCommand() 
Inherited
inherited_from \Swift_Transport_AbstractSmtpTransport::_doHeloCommand()
inherited_from \Swift_Transport_SendmailTransport::_doHeloCommand()

Send the MAIL FROM command

_doMailFromCommand($address) 
Inherited
inherited_from \Swift_Transport_AbstractSmtpTransport::_doMailFromCommand()
inherited_from \Swift_Transport_SendmailTransport::_doMailFromCommand()

Parameters

$address

Send the RCPT TO command

_doRcptToCommand($address) 
Inherited
inherited_from \Swift_Transport_AbstractSmtpTransport::_doRcptToCommand()
inherited_from \Swift_Transport_SendmailTransport::_doRcptToCommand()

Parameters

$address

Get the params to initialize the buffer

_getBufferParams() 
Inherited
inherited_from \Swift_Transport_SendmailTransport::_getBufferParams()

Get an entire multi-line response using its sequence number

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

Parameters

$seq

Determine the best-use reverse path for this message

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

Parameters

$message

Read the opening SMTP greeting

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

Stream the contents of the message over the buffer

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

Parameters

$message

Throw a TransportException, first sending it to any listeners

_throwException(\Swift_TransportException $e) 
Inherited
inherited_from \Swift_Transport_AbstractSmtpTransport::_throwException()
inherited_from \Swift_Transport_SendmailTransport::_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()
inherited_from \Swift_Transport_SendmailTransport::_doMailTransaction()

Parameters

$message

$reversePath

$recipients

$failedRecipients

Determine is the $hostname is a fully-qualified name

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

Parameters

$hostname

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

_lookupHostname() 
Inherited
inherited_from \Swift_Transport_AbstractSmtpTransport::_lookupHostname()
inherited_from \Swift_Transport_SendmailTransport::_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()
inherited_from \Swift_Transport_SendmailTransport::_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()
inherited_from \Swift_Transport_SendmailTransport::_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()
inherited_from \Swift_Transport_SendmailTransport::_sendTo()

Parameters

$message

$reversePath

$to

$failedRecipients

 Properties

 

$_buffer 
Inherited
inherited_from \Swift_Transport_AbstractSmtpTransport::$$_buffer
inherited_from \Swift_Transport_SendmailTransport::$$_buffer
 

$_domain 
Inherited
inherited_from \Swift_Transport_AbstractSmtpTransport::$$_domain
inherited_from \Swift_Transport_SendmailTransport::$$_domain
 

$_eventDispatcher 
Inherited
inherited_from \Swift_Transport_AbstractSmtpTransport::$$_eventDispatcher
inherited_from \Swift_Transport_SendmailTransport::$$_eventDispatcher
 

$_sourceIp 
Inherited
inherited_from \Swift_Transport_AbstractSmtpTransport::$$_sourceIp
inherited_from \Swift_Transport_SendmailTransport::$$_sourceIp
 

$_started 
Inherited
inherited_from \Swift_Transport_AbstractSmtpTransport::$$_started
inherited_from \Swift_Transport_SendmailTransport::$$_started
 

$_params : array
Inherited
access protected
inherited_from \Swift_Transport_SendmailTransport::$$_params