SmtpScheme uses ConstantsTrait
The two URI schemes accepted by an SMTP transport DSN.
smtp://user:pass@host:587 // STARTTLS (or cleartext) smtps://user:pass@host:465 // implicit TLS
Values are lowercased — the canonical form used in a DSN.
Tags
Table of Contents
Constants
- SMTP : string = 'smtp'
- SMTP, optionally upgraded via STARTTLS. Default port `587` (or `25` cleartext).
- SMTPS : string = 'smtps'
- SMTP over implicit TLS. Default port `465`.
Methods
- defaultPort() : int|null
- Returns the default TCP port for a scheme, or `null` when the scheme has no well-known default.
Constants
SMTP
SMTP, optionally upgraded via STARTTLS. Default port `587` (or `25` cleartext).
public
string
SMTP
= 'smtp'
SMTPS
SMTP over implicit TLS. Default port `465`.
public
string
SMTPS
= 'smtps'
Methods
defaultPort()
Returns the default TCP port for a scheme, or `null` when the scheme has no well-known default.
public
static defaultPort(string $scheme) : int|null
Parameters
- $scheme : string
-
One of the class constants (case-insensitive).
Return values
int|null —The default port, or null if unknown.