HumHub Documentation (unofficial)

SmtpTransport extends AbstractTransport
in package

Sends emails over SMTP.

Tags
author

Fabien Potencier fabien@symfony.com

author

Chris Corbyn

Table of Contents

Properties

$dispatcher  : mixed
$domain  : mixed
$lastMessageTime  : mixed
$lastSent  : mixed
$logger  : mixed
$pingThreshold  : mixed
$rate  : mixed
$restartCounter  : mixed
$restartThreshold  : mixed
$restartThresholdSleep  : mixed
$started  : mixed
$stream  : mixed

Methods

__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()  : $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).
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.
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

$restartThresholdSleep

private mixed $restartThresholdSleep = 0

Methods

__sleep()

public __sleep() : array<string|int, mixed>
Return values
array<string|int, mixed>

__toString()

public __toString() : string
Return values
string

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

setLocalDomain()

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
$this

setMaxPerSecond()

Sets the maximum number of messages to send per second (0 to disable).

public setMaxPerSecond(float $rate) : $this
Parameters
$rate : float
Return values
$this

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 = 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
$this

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
throws
TransportException

if a response code is incorrect

checkRestartThreshold()

private checkRestartThreshold() : void

doMailFromCommand()

private doMailFromCommand(string $address) : void
Parameters
$address : string

doRcptToCommand()

private doRcptToCommand(string $address) : void
Parameters
$address : string

getFullResponse()

private getFullResponse() : string
Return values
string

        
On this page

Search results