SendmailTransport
extends AbstractTransport
in package
SendmailTransport for sending mail through a Sendmail/Postfix (etc..) binary.
Transport can be instantiated through SendmailTransportFactory or NativeTransportFactory:
- SendmailTransportFactory to use most common sendmail path and recommended options
- NativeTransportFactory when configuration is set via php.ini
Tags
Table of Contents
Properties
- $command : mixed
- $dispatcher : mixed
- $lastSent : mixed
- $logger : mixed
- $rate : mixed
- $stream : mixed
- $transport : mixed
Methods
- __construct() : mixed
- Constructor.
- __toString() : string
- send() : SentMessage|null
- setMaxPerSecond() : $this
- Sets the maximum number of messages to send per second (0 to disable).
- doSend() : void
- getLogger() : LoggerInterface
- stringifyAddresses() : array<string|int, string>
- checkThrottling() : mixed
Properties
$command
private
mixed
$command
= '/usr/sbin/sendmail -bs'
$dispatcher
private
mixed
$dispatcher
$lastSent
private
mixed
$lastSent
= 0
$logger
private
mixed
$logger
$rate
private
mixed
$rate
= 0
$stream
private
mixed
$stream
$transport
private
mixed
$transport
Methods
__construct()
Constructor.
public
__construct([string|null $command = null ][, EventDispatcherInterface|null $dispatcher = null ][, LoggerInterface|null $logger = null ]) : mixed
Supported modes are -bs and -t, with any additional flags desired.
The recommended mode is "-bs" since it is interactive and failure notifications are hence possible. Note that the -t mode does not support error reporting and does not support Bcc properly (the Bcc headers are not removed).
If using -t mode, you are strongly advised to include -oi or -i in the flags (like /usr/sbin/sendmail -oi -t)
-f
Parameters
- $command : string|null = null
- $dispatcher : EventDispatcherInterface|null = null
- $logger : LoggerInterface|null = null
__toString()
public
__toString() : string
Return values
stringsend()
public
send(RawMessage $message[, Envelope|null $envelope = null ]) : SentMessage|null
Parameters
- $message : RawMessage
- $envelope : Envelope|null = null
Return values
SentMessage|nullsetMaxPerSecond()
Sets the maximum number of messages to send per second (0 to disable).
public
setMaxPerSecond(float $rate) : $this
Parameters
- $rate : float
Return values
$thisdoSend()
protected
doSend(SentMessage $message) : void
Parameters
- $message : SentMessage
getLogger()
protected
getLogger() : LoggerInterface
Return values
LoggerInterfacestringifyAddresses()
protected
stringifyAddresses(array<string|int, Address> $addresses) : array<string|int, string>
Parameters
- $addresses : array<string|int, Address>
Return values
array<string|int, string>checkThrottling()
private
checkThrottling() : mixed