OhMySmtpSmtpTransport
extends EsmtpTransport
in package
Sends Emails over SMTP with ESMTP support.
Tags
Table of Contents
Properties
- $authenticators : mixed
- $dispatcher : mixed
- $domain : mixed
- $lastMessageTime : mixed
- $lastSent : mixed
- $logger : mixed
- $password : mixed
- $pingThreshold : mixed
- $rate : mixed
- $restartCounter : mixed
- $restartThreshold : mixed
- $restartThresholdSleep : mixed
- $started : mixed
- $stream : mixed
- $username : mixed
Methods
- __construct() : mixed
- __destruct() : mixed
- __sleep() : array<string|int, mixed>
- __toString() : string
- __wakeup() : mixed
- addAuthenticator() : void
- getLocalDomain() : string
- Gets the name of the domain that will be used in HELO.
- getPassword() : string
- getStream() : AbstractStream
- getUsername() : string
- send() : SentMessage|null
- setLocalDomain() : $this
- Sets the name of the local domain that will be used in HELO.
- setMaxPerSecond() : $this
- Sets the maximum number of messages to send per second (0 to disable).
- setPassword() : $this
- setPingThreshold() : $this
- Sets the minimum number of seconds required between two messages, before the server is pinged.
- setRestartThreshold() : $this
- Sets the maximum number of messages to send before re-starting the transport.
- setUsername() : $this
- doHeloCommand() : void
- doSend() : void
- getLogger() : LoggerInterface
- stringifyAddresses() : array<string|int, string>
- addOhMySmtpHeaders() : void
- assertResponseCode() : void
- callHeloCommand() : array<string|int, mixed>
- checkRestartThreshold() : void
- checkThrottling() : mixed
- doMailFromCommand() : void
- doRcptToCommand() : void
- getFullResponse() : string
- handleAuth() : void
- ping() : void
- start() : void
- stop() : void
Properties
$authenticators
private
mixed
$authenticators
= []
$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
$password
private
mixed
$password
= ''
$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
$username
private
mixed
$username
= ''
Methods
__construct()
public
__construct(string $id[, EventDispatcherInterface|null $dispatcher = null ][, LoggerInterface|null $logger = null ]) : mixed
Parameters
- $id : string
- $dispatcher : EventDispatcherInterface|null = null
- $logger : LoggerInterface|null = null
__destruct()
public
__destruct() : 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
addAuthenticator()
public
addAuthenticator(AuthenticatorInterface $authenticator) : void
Parameters
- $authenticator : AuthenticatorInterface
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
stringgetPassword()
public
getPassword() : string
Return values
stringgetStream()
public
getStream() : AbstractStream
Return values
AbstractStreamgetUsername()
public
getUsername() : string
Return values
stringsend()
public
send(RawMessage $message[, Envelope|null $envelope = null ]) : SentMessage|null
Parameters
- $message : RawMessage
- $envelope : Envelope|null = null
Return values
SentMessage|nullsetLocalDomain()
Sets the name of the local domain that will be used in HELO.
public
setLocalDomain(string $domain) : $this
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
$thissetMaxPerSecond()
Sets the maximum number of messages to send per second (0 to disable).
public
setMaxPerSecond(float $rate) : $this
Parameters
- $rate : float
Return values
$thissetPassword()
public
setPassword(string $password) : $this
Parameters
- $password : string
Return values
$thissetPingThreshold()
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
$thissetRestartThreshold()
Sets the maximum number of messages to send before re-starting the transport.
public
setRestartThreshold(int $threshold[, int $sleep = 0 ]) : $this
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 = 0
-
The number of seconds to sleep between stopping and re-starting the transport
Return values
$thissetUsername()
public
setUsername(string $username) : $this
Parameters
- $username : string
Return values
$thisdoHeloCommand()
protected
doHeloCommand() : void
doSend()
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>addOhMySmtpHeaders()
private
addOhMySmtpHeaders(Message $message) : void
Parameters
- $message : Message
assertResponseCode()
private
assertResponseCode(string $response, array<string|int, mixed> $codes) : void
Parameters
- $response : string
- $codes : array<string|int, mixed>
Tags
callHeloCommand()
private
callHeloCommand() : array<string|int, mixed>
Return values
array<string|int, mixed>checkRestartThreshold()
private
checkRestartThreshold() : void
checkThrottling()
private
checkThrottling() : mixed
doMailFromCommand()
private
doMailFromCommand(string $address) : void
Parameters
- $address : string
doRcptToCommand()
private
doRcptToCommand(string $address) : void
Parameters
- $address : string
getFullResponse()
private
getFullResponse() : string
Return values
stringhandleAuth()
private
handleAuth(array<string|int, mixed> $modes) : void
Parameters
- $modes : array<string|int, mixed>
ping()
private
ping() : void
start()
private
start() : void
stop()
private
stop() : void