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.
Methods
Create a new SendmailTransport with $buf for I/O.
__construct(\Swift_Transport_IoBuffer $buf, \Swift_Events_EventDispatcher $dispatcher)
Destructor.
__destruct()
Inherited
inherited_from |
\Swift_Transport_AbstractSmtpTransport::__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() |
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() |
Returns
Get the sendmail command which will be invoked.
getCommand() : string
Get the name of the domain Swift will identify as.
getLocalDomain() : string
Inherited
inherited_from |
\Swift_Transport_AbstractSmtpTransport::getLocalDomain() |
Returns
string
Returns the ip used to connect to the destination
getSourceIp() : string
Inherited
inherited_from |
\Swift_Transport_AbstractSmtpTransport::getSourceIp() |
Returns
string
Test if an SMTP connection has been established.
isStarted() : boolean
Inherited
inherited_from |
\Swift_Transport_AbstractSmtpTransport::isStarted() |
Returns
boolean
Register a plugin.
registerPlugin(\Swift_Events_EventListener $plugin)
Inherited
inherited_from |
\Swift_Transport_AbstractSmtpTransport::registerPlugin() |
Parameters
Reset the current mail transaction.
reset()
Inherited
inherited_from |
\Swift_Transport_AbstractSmtpTransport::reset() |
Send the given Message.
send(\Swift_Mime_Message $message, string[] $failedRecipients) : int
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).
Parameters
$failedRecipients
string[]
&$failedRecipients to collect failures by-reference
Returns
int
Set the command to invoke.
setCommand(string $command) : \Swift_Transport_SendmailTransport
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.
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() |
Parameters
$domain
string
Returns
Sets the sourceIp
setSourceIp(string $source)
Inherited
inherited_from |
\Swift_Transport_AbstractSmtpTransport::setSourceIp() |
Parameters
$source
string
Start the standalone SMTP session if running in -bs mode.
start()
Stop the SMTP connection.
stop()
Inherited
inherited_from |
\Swift_Transport_AbstractSmtpTransport::stop() |
Throws an Exception if a response code is incorrect
_assertResponseCode($response, $wanted)
Inherited
inherited_from |
\Swift_Transport_AbstractSmtpTransport::_assertResponseCode() |
Parameters
$response
$wanted
Send the DATA command
_doDataCommand()
Inherited
inherited_from |
\Swift_Transport_AbstractSmtpTransport::_doDataCommand() |
Send the HELO welcome
_doHeloCommand()
Inherited
inherited_from |
\Swift_Transport_AbstractSmtpTransport::_doHeloCommand() |
Send the MAIL FROM command
_doMailFromCommand($address)
Inherited
inherited_from |
\Swift_Transport_AbstractSmtpTransport::_doMailFromCommand() |
Parameters
$address
Send the RCPT TO command
_doRcptToCommand($address)
Inherited
inherited_from |
\Swift_Transport_AbstractSmtpTransport::_doRcptToCommand() |
Parameters
$address
Get the params to initialize the buffer
_getBufferParams()
Get an entire multi-line response using its sequence number
_getFullResponse($seq)
Inherited
inherited_from |
\Swift_Transport_AbstractSmtpTransport::_getFullResponse() |
Parameters
$seq
Determine the best-use reverse path for this message
_getReversePath(\Swift_Mime_Message $message)
Inherited
inherited_from |
\Swift_Transport_AbstractSmtpTransport::_getReversePath() |
Parameters
$message
Read the opening SMTP greeting
_readGreeting()
Inherited
inherited_from |
\Swift_Transport_AbstractSmtpTransport::_readGreeting() |
Stream the contents of the message over the buffer
_streamMessage(\Swift_Mime_Message $message)
Inherited
inherited_from |
\Swift_Transport_AbstractSmtpTransport::_streamMessage() |
Parameters
$message
Throw a TransportException, first sending it to any listeners
_throwException(\Swift_TransportException $e)
Inherited
inherited_from |
\Swift_Transport_AbstractSmtpTransport::_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() |
Parameters
$message
$reversePath
$recipients
$failedRecipients
Determine is the $hostname is a fully-qualified name
_isFqdn($hostname)
Inherited
inherited_from |
\Swift_Transport_AbstractSmtpTransport::_isFqdn() |
Parameters
$hostname
Try to determine the hostname of the server this is run on
_lookupHostname()
Inherited
inherited_from |
\Swift_Transport_AbstractSmtpTransport::_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() |
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() |
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() |
Parameters
$message
$reversePath
$to
$failedRecipients
Properties
$_buffer
Inherited
inherited_from |
\Swift_Transport_AbstractSmtpTransport::$$_buffer |
$_domain
Inherited
inherited_from |
\Swift_Transport_AbstractSmtpTransport::$$_domain |
$_eventDispatcher
Inherited
inherited_from |
\Swift_Transport_AbstractSmtpTransport::$$_eventDispatcher |
$_sourceIp
Inherited
inherited_from |
\Swift_Transport_AbstractSmtpTransport::$$_sourceIp |
$_started
Inherited
inherited_from |
\Swift_Transport_AbstractSmtpTransport::$$_started |