Class Swift_Transport_SendmailTransport

InheritanceSwift_Transport_SendmailTransport » Swift_Transport_AbstractSmtpTransport
ImplementsSwift_Transport
SubclassesSwift_SendmailTransport

SendmailTransport for sending mail through a Sendmail/Postfix (etc.

.) binary.

Supported modes are -bs and -t, with any additional flags desired. It is advised to use -bs mode since error reporting with -t mode is not possible.

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() Create a new SendmailTransport with $buf for I/O. Swift_Transport_SendmailTransport
__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
getCommand() Get the sendmail command which will be invoked. Swift_Transport_SendmailTransport
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_SendmailTransport
setCommand() Set the command to invoke. Swift_Transport_SendmailTransport
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 standalone SMTP session if running in -bs mode. Swift_Transport_SendmailTransport
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() Get the params to initialize the buffer Swift_Transport_SendmailTransport
_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

Method Details

__construct() public method

Create a new SendmailTransport with $buf for I/O.

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

Get the params to initialize the buffer

protected void _getBufferParams ( )
getCommand() public method

Get the sendmail command which will be invoked.

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

public int send ( Swift_Mime_Message $message, <b>&</b>$failedRecipients null )
$message Swift_Mime_Message
$failedRecipients string[]

An array of failures by-reference

setCommand() public method

Set the command to invoke.

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.

public Swift_Transport_SendmailTransport setCommand ( $command )
$command string
start() public method

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

public void start ( )