Message

Type
Class
Namespace
craft\mail
Inherits
craft\mail\Message » yii\symfonymailer\Message
Since
3.0.0

Represents an email message.

View source (opens new window)

# Public Properties

Property Description
error \Symfony\Component\Mailer\Exception\TransportExceptionInterface, null (opens new window) – The caught error object, if the message failed to send
key string (opens new window), null (opens new window) – The key of the message that should be loaded
language string (opens new window), null (opens new window) – The language that the email should be sent in, based on the first craft\elements\User model passed into setTo() with a preferred language
variables array (opens new window), null (opens new window) – Any variables that should be applied to the template when it is rendered

# error

Type
\Symfony\Component\Mailer\Exception\TransportExceptionInterface, null (opens new window)
Default value
null

The caught error object, if the message failed to send

View source (opens new window)

# key

Type
string (opens new window), null (opens new window)
Default value
null

The key of the message that should be loaded

View source (opens new window)

# language

Type
string (opens new window), null (opens new window)
Default value
null

The language that the email should be sent in, based on the first craft\elements\User model passed into setTo() with a preferred language

View source (opens new window)

# variables

Type
array (opens new window), null (opens new window)
Default value
null

Any variables that should be applied to the template when it is rendered

View source (opens new window)

# Public Methods

Method Description
setBcc() Sets the BCC (hidden copy receiver) addresses of this message.
setCc() Sets the CC (additional copy receiver) addresses of this message.
setFrom() Sets the message sender.
setReplyTo() Sets the Reply-To email.
setTo() Sets the message recipient(s).

# setBcc()

Sets the BCC (hidden copy receiver) addresses of this message.

View source (opens new window)

Arguments

Returns

self – Self reference

# setCc()

Sets the CC (additional copy receiver) addresses of this message.

View source (opens new window)

Arguments

Returns

self – Self reference

# setFrom()

Sets the message sender.

View source (opens new window)

Arguments

Returns

self – Self reference

# setReplyTo()

Since
3.4.0

Sets the Reply-To email.

View source (opens new window)

Arguments

Returns

self – Self reference

# setTo()

Sets the message recipient(s).

View source (opens new window)

Arguments

Returns

self – Self reference