SmtpTransport
extends AbstractTransport
in package
Sends emails over SMTP.
Tags
Table of Contents
- $dispatcher : mixed
- $domain : mixed
- $lastMessageTime : mixed
- $lastSent : mixed
- $logger : mixed
- $pingThreshold : mixed
- $rate : mixed
- $restartCounter : mixed
- $restartThreshold : mixed
- $restartThresholdSleep : mixed
- $started : mixed
- $stream : mixed
- __construct() : mixed
- __destruct() : mixed
- __sleep() : array<string|int, mixed>
- __toString() : string
- __wakeup() : mixed
- getLocalDomain() : string
- Gets the name of the domain that will be used in HELO.
- getStream() : AbstractStream
- send() : SentMessage|null
- setLocalDomain() : self
- Sets the name of the local domain that will be used in HELO.
- setMaxPerSecond() : self
- Sets the maximum number of messages to send per second (0 to disable).
- setPingThreshold() : $this
- Sets the minimum number of seconds required between two messages, before the server is pinged.
- setRestartThreshold() : self
- Sets the maximum number of messages to send before re-starting the transport.
- doHeloCommand() : void
- doSend() : void
- getLogger() : LoggerInterface
- stringifyAddresses() : array<string|int, string>
- assertResponseCode() : void
- checkRestartThreshold() : void
- checkThrottling() : mixed
- doMailFromCommand() : void
- doRcptToCommand() : void
- getFullResponse() : string
- ping() : void
- start() : void
- stop() : void
Properties
$dispatcher
private
mixed
$dispatcher
$domain
private
mixed
$domain
= '[127.0.0.1]'
$lastMessageTime
private
mixed
$lastMessageTime
= 0
$lastSent
private
mixed
$lastSent
= 0
$logger
private
mixed
$logger
$pingThreshold
private
mixed
$pingThreshold
= 100
$rate
private
mixed
$rate
= 0
$restartCounter
private
mixed
$restartCounter
$restartThreshold
private
mixed
$restartThreshold
= 100
$restartThresholdSleep
private
mixed
$restartThresholdSleep
= 0
$started
private
mixed
$started
= false
$stream
private
mixed
$stream
Methods
__construct()
public
__construct([AbstractStream $stream = null ][, EventDispatcherInterface $dispatcher = null ][, LoggerInterface $logger = null ]) : mixed
Parameters
- $stream : AbstractStream = null
- $dispatcher : EventDispatcherInterface = null
- $logger : LoggerInterface = null
Return values
mixed —__destruct()
public
__destruct() : mixed
Return values
mixed —__sleep()
public
__sleep() : array<string|int, mixed>
Return values
array<string|int, mixed> —__toString()
public
__toString() : string
Return values
string —__wakeup()
public
__wakeup() : mixed
Return values
mixed —getLocalDomain()
Gets the name of the domain that will be used in HELO.
public
getLocalDomain() : string
If an IP address was specified, this will be returned wrapped in square brackets as described in RFC 5321, section 4.1.3.
Return values
string —getStream()
public
getStream() : AbstractStream
Return values
AbstractStream —send()
public
send(RawMessage $message[, Envelope $envelope = null ]) : SentMessage|null
Parameters
- $message : RawMessage
- $envelope : Envelope = null
Return values
SentMessage|null —setLocalDomain()
Sets the name of the local domain that will be used in HELO.
public
setLocalDomain(string $domain) : self
This should be a fully-qualified domain name and should be truly the domain you're using.
If your server does not have a domain name, use the IP address. This will automatically be wrapped in square brackets as described in RFC 5321, section 4.1.3.
Parameters
- $domain : string
Return values
self —setMaxPerSecond()
Sets the maximum number of messages to send per second (0 to disable).
public
setMaxPerSecond(float $rate) : self
Parameters
- $rate : float
Return values
self —setPingThreshold()
Sets the minimum number of seconds required between two messages, before the server is pinged.
public
setPingThreshold(int $seconds) : $this
If the transport wants to send a message and the time since the last message exceeds the specified threshold, the transport will ping the server first (NOOP command) to check if the connection is still alive. Otherwise the message will be sent without pinging the server first.
Do not set the threshold too low, as the SMTP server may drop the connection if there are too many non-mail commands (like pinging the server with NOOP).
By default, the threshold is set to 100 seconds.
Parameters
- $seconds : int
-
The minimum number of seconds between two messages required to ping the server
Return values
$this —setRestartThreshold()
Sets the maximum number of messages to send before re-starting the transport.
public
setRestartThreshold(int $threshold, int $sleep) : self
By default, the threshold is set to 100 (and no sleep at restart).
Parameters
- $threshold : int
-
The maximum number of messages (0 to disable)
- $sleep : int
-
The number of seconds to sleep between stopping and re-starting the transport
Return values
self —doHeloCommand()
protected
doHeloCommand() : void
Return values
void —doSend()
protected
doSend(SentMessage $message) : void
Parameters
- $message : SentMessage
Return values
void —getLogger()
protected
getLogger() : LoggerInterface
Return values
LoggerInterface —stringifyAddresses()
protected
stringifyAddresses(array<string|int, Address> $addresses) : array<string|int, string>
Parameters
- $addresses : array<string|int, Address>
Return values
array<string|int, string> —assertResponseCode()
private
assertResponseCode(string $response, array<string|int, mixed> $codes) : void
Parameters
- $response : string
- $codes : array<string|int, mixed>
Tags
Return values
void —checkRestartThreshold()
private
checkRestartThreshold() : void
Return values
void —checkThrottling()
private
checkThrottling() : mixed
Return values
mixed —doMailFromCommand()
private
doMailFromCommand(string $address) : void
Parameters
- $address : string
Return values
void —doRcptToCommand()
private
doRcptToCommand(string $address) : void
Parameters
- $address : string
Return values
void —getFullResponse()
private
getFullResponse() : string
Return values
string —ping()
private
ping() : void
Return values
void —start()
private
start() : void
Return values
void —stop()
private
stop() : void