Properties

$smtp

$smtp : boolean

Whether SMTP should be used.

Type

boolean

$smtpHostname

$smtpHostname : string

The SMTP hostname.

Type

string

$smtpPort

$smtpPort : integer

The SMTP port.

Type

integer

$smtpSecurity

$smtpSecurity : string

The SMTP security type.

Type

string

$smtpAuth

$smtpAuth : boolean

Whether SMTP requires authentication.

Type

boolean

$smtpUsername

$smtpUsername : string

The SMTP username.

Type

string

$smtpPassword

$smtpPassword : string

The SMTP password.

Type

string

$defaultFrom

$defaultFrom : string

The default sender's email address.

Type

string

$defaultReplyTo

$defaultReplyTo : string

The default "Reply-To" email address.

Type

string

$defaultTrack

$defaultTrack : boolean

Whether the email should be tracked by default.

Type

boolean

$defaultLog

$defaultLog : boolean

Whether the email should be logged by default.

Type

boolean

Methods

defaults()

defaults() : array

Default email configuration.

Returns

array

setSmtp()

setSmtp(boolean  $smtp) : \Charcoal\Email\EmailConfig

Set whether SMTP should be used for sending the email.

Parameters

boolean $smtp

If the email should be sent using SMTP or not.

Throws

\InvalidArgumentException

If the SMTP state is not a boolean.

Returns

\Charcoal\Email\EmailConfig

Chainable

smtp()

smtp() : boolean

Determine if SMTP should be used.

Returns

boolean

setSmtpHostname()

setSmtpHostname(string  $hostname) : \Charcoal\Email\EmailConfig

Set the SMTP hostname to be used.

Parameters

string $hostname

The SMTP hostname.

Throws

\InvalidArgumentException

If the SMTP hostname is not a string.

Returns

\Charcoal\Email\EmailConfig

Chainable

smtpHostname()

smtpHostname() : string

Get the SMTP hostname.

Returns

string

setSmtpPort()

setSmtpPort(integer  $port) : \Charcoal\Email\EmailConfig

Set the SMTP port to be used.

Parameters

integer $port

The SMTP port.

Throws

\InvalidArgumentException

If the SMTP port is not an integer.

Returns

\Charcoal\Email\EmailConfig

Chainable

smtpPort()

smtpPort() : integer

Get the SMTP port.

Returns

integer

setSmtpAuth()

setSmtpAuth(boolean  $auth) : \Charcoal\Email\EmailConfig

Set whether SMTP requires authentication.

Parameters

boolean $auth

The SMTP authentication flag (if auth is required).

Returns

\Charcoal\Email\EmailConfig

Chainable

smtpAuth()

smtpAuth() : boolean

Determine if SMTP requires authentication.

Returns

boolean

setSmtpUsername()

setSmtpUsername(string  $username) : \Charcoal\Email\EmailConfig

Set the SMTP username to be used.

Parameters

string $username

The SMTP username, if using authentication.

Throws

\InvalidArgumentException

If the SMTP username is not a string.

Returns

\Charcoal\Email\EmailConfig

Chainable

smtpUsername()

smtpUsername() : string

Get the SMTP username.

Returns

string

setSmtpPassword()

setSmtpPassword(string  $password) : \Charcoal\Email\EmailConfig

Set the SMTP password to be used.

Parameters

string $password

The SMTP password, if using authentication.

Throws

\InvalidArgumentException

If the SMTP password is not a string.

Returns

\Charcoal\Email\EmailConfig

Chainable

smtpPassword()

smtpPassword() : string

Get the SMTP password.

Returns

string

setSmtpSecurity()

setSmtpSecurity(string  $security) : \Charcoal\Email\EmailConfig

Set the SMTP security type to be used.

Parameters

string $security

The SMTP security type (empty, "TLS", or "SSL").

Throws

\InvalidArgumentException

If the security type is not valid (empty, "TLS", or "SSL").

Returns

\Charcoal\Email\EmailConfig

Chainable

smtpSecurity()

smtpSecurity() : string

Get the SMTP security type.

Returns

string

setDefaultFrom()

setDefaultFrom(string|array  $email) : \Charcoal\Email\EmailConfig

Set the default sender's email address.

Parameters

string|array $email

The default "From" email address.

Throws

\InvalidArgumentException

If the email address is invalid.

Returns

\Charcoal\Email\EmailConfig

Chainable

defaultFrom()

defaultFrom() : string

Get the sender email address.

Returns

string

setDefaultReplyTo()

setDefaultReplyTo(string|array  $email) : \Charcoal\Email\EmailConfig

Set the default "Reply-To" email address.

Parameters

string|array $email

The default "Reply-To" email address.

Throws

\InvalidArgumentException

If the email address is invalid.

Returns

\Charcoal\Email\EmailConfig

Chainable

defaultReplyTo()

defaultReplyTo() : string

Get the "Reply-To" email address.

Returns

string

setDefaultLog()

setDefaultLog(boolean  $log) : \Charcoal\Email\EmailConfig

Set whether the email should be logged by defaultd.

Parameters

boolean $log

The default log flag.

Returns

\Charcoal\Email\EmailConfig

Chainable

defaultLog()

defaultLog() : boolean

Determine if the email should be logged by default.

Returns

boolean

setDefaultTrack()

setDefaultTrack(boolean  $track) : \Charcoal\Email\EmailConfig

Set whether the email should be tracked by default.

Parameters

boolean $track

The default track flag.

Returns

\Charcoal\Email\EmailConfig

Chainable

defaultTrack()

defaultTrack() : boolean

Determine if the email should be tracked by default.

Returns

boolean

emailToArray()

emailToArray(mixed  $var) : string

Convert an email address (RFC822) into a proper array notation.

Parameters

mixed $var

An email array (containing an "email" key and optionally a "name" key).

Throws

\InvalidArgumentException

If the email is invalid.

Returns

string

emailFromArray()

emailFromArray(array  $arr) : string

Convert an email address array to a RFC-822 string notation.

Parameters

array $arr

An email array (containing an "email" key and optionally a "name" key).

Throws

\InvalidArgumentException

If the email array is invalid.

Returns

string