PHPMailer

DSNConfigurator
in package

Configure PHPMailer with DSN string.

Tags
see
https://en.wikipedia.org/wiki/Data_source_name
author

Oleg Voronkovich oleg-voronkovich@yandex.ru

Table of Contents

Methods

configure()  : PHPMailer
Configure PHPMailer instance with DSN string.
mailer()  : PHPMailer
Create new PHPMailer instance configured by DSN.
parseUrl()  : array<string|int, mixed>|false
Parse a URL.
applyConfig()  : mixed
Apply configuration to mailer.
configureOptions()  : mixed
Configure options.
configureSMTP()  : mixed
Configure SMTP.
parseDSN()  : array<string|int, mixed>
Parse DSN string.

Methods

mailer()

Create new PHPMailer instance configured by DSN.

public static mailer(string $dsn[, bool $exceptions = null ]) : PHPMailer
Parameters
$dsn : string

DSN

$exceptions : bool = null

Should we throw external exceptions?

Return values
PHPMailer

parseUrl()

Parse a URL.

protected parseUrl(string $url) : array<string|int, mixed>|false

Wrapper for the built-in parse_url function to work around a bug in PHP 5.5.

Parameters
$url : string

URL

Return values
array<string|int, mixed>|false

applyConfig()

Apply configuration to mailer.

private applyConfig(PHPMailer $mailer, array<string|int, mixed> $config) : mixed
Parameters
$mailer : PHPMailer

PHPMailer instance

$config : array<string|int, mixed>

Configuration

Tags
throws
Exception

If scheme is invalid

configureOptions()

Configure options.

private configureOptions(PHPMailer $mailer, array<string|int, mixed> $options) : mixed
Parameters
$mailer : PHPMailer

PHPMailer instance

$options : array<string|int, mixed>

Options

Tags
throws
Exception

If option is unknown

configureSMTP()

Configure SMTP.

private configureSMTP(PHPMailer $mailer, array<string|int, mixed> $config) : mixed
Parameters
$mailer : PHPMailer

PHPMailer instance

$config : array<string|int, mixed>

Configuration

parseDSN()

Parse DSN string.

private parseDSN(string $dsn) : array<string|int, mixed>
Parameters
$dsn : string

DSN

Tags
throws
Exception

If DSN is malformed

Return values
array<string|int, mixed>

Configuration


        
On this page

Search results