Class Swift_Transport_SendmailTransport
Inheritance | Swift_Transport_SendmailTransport » Swift_Transport_AbstractSmtpTransport |
---|---|
Implements | Swift_Transport |
Subclasses | Swift_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
Property | Type | Description | Defined 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
Protected Methods
Method Details
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 |
Get the params to initialize the buffer
protected void _getBufferParams ( ) |
Get the sendmail command which will be invoked.
public string getCommand ( ) |
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 |
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
The recommended mode is "-bs" since it is interactive and failure notifications are hence possible.
public Swift_Transport_SendmailTransport setCommand ( $command ) | ||
$command | string |
Start the standalone SMTP session if running in -bs mode.
public void start ( ) |