Class yii\swiftmailer\Message
Inheritance | yii\swiftmailer\Message » yii\mail\BaseMessage » yii\base\Object |
---|---|
Implements | yii\base\Configurable, yii\mail\MessageInterface |
Available since version | 2.0 |
Source Code | https://github.com/yiisoft/yii2-swiftmailer/blob/master/Message.php |
Message implements a message class based on SwiftMailer.
See also:
Public Properties
Property | Type | Description | Defined By |
---|---|---|---|
$bcc | array | The Bcc (hidden copy receiver) addresses of this message. | yii\swiftmailer\Message |
$cc | array | The Cc (additional copy receiver) addresses of this message. | yii\swiftmailer\Message |
$charset | string | The character set of this message. | yii\swiftmailer\Message |
$from | string | The sender | yii\swiftmailer\Message |
$htmlBody | string | Message HTML content. | yii\swiftmailer\Message |
$mailer | yii\mail\MailerInterface | The mailer instance that created this message. | yii\mail\BaseMessage |
$replyTo | string | The reply-to address of this message. | yii\swiftmailer\Message |
$subject | string | The message subject | yii\swiftmailer\Message |
$swiftMessage | \Swift_Message | Swift message instance. | yii\swiftmailer\Message |
$textBody | string | Message plain text content. | yii\swiftmailer\Message |
$to | array | The message recipients | yii\swiftmailer\Message |
Public Methods
Method | Description | Defined By |
---|---|---|
__call() | Calls the named method which is not a class method. | yii\base\Object |
__construct() | Constructor. | yii\base\Object |
__get() | Returns the value of an object property. | yii\base\Object |
__isset() | Checks if a property is set, i.e. defined and not null. | yii\base\Object |
__set() | Sets value of an object property. | yii\base\Object |
__toString() | PHP magic method that returns the string representation of this object. | yii\mail\BaseMessage |
__unset() | Sets an object property to null. | yii\base\Object |
attach() | Attaches existing file to the email message. | yii\swiftmailer\Message |
attachContent() | Attach specified content as file for the email message. | yii\swiftmailer\Message |
canGetProperty() | Returns a value indicating whether a property can be read. | yii\base\Object |
canSetProperty() | Returns a value indicating whether a property can be set. | yii\base\Object |
className() | Returns the fully qualified name of this class. | yii\base\Object |
embed() | Attach a file and return it's CID source. | yii\swiftmailer\Message |
embedContent() | Attach a content as file and return it's CID source. | yii\swiftmailer\Message |
getBcc() | Returns the Bcc (hidden copy receiver) addresses of this message. | yii\swiftmailer\Message |
getCc() | Returns the Cc (additional copy receiver) addresses of this message. | yii\swiftmailer\Message |
getCharset() | Returns the character set of this message. | yii\swiftmailer\Message |
getFrom() | Returns the message sender. | yii\swiftmailer\Message |
getReplyTo() | Returns the reply-to address of this message. | yii\swiftmailer\Message |
getSubject() | Returns the message subject. | yii\swiftmailer\Message |
getSwiftMessage() | yii\swiftmailer\Message | |
getTo() | Returns the message recipient(s). | yii\swiftmailer\Message |
hasMethod() | Returns a value indicating whether a method is defined. | yii\base\Object |
hasProperty() | Returns a value indicating whether a property is defined. | yii\base\Object |
init() | Initializes the object. | yii\base\Object |
send() | Sends this email message. | yii\mail\BaseMessage |
setBcc() | Sets the Bcc (hidden copy receiver) addresses of this message. | yii\swiftmailer\Message |
setCc() | Sets the Cc (additional copy receiver) addresses of this message. | yii\swiftmailer\Message |
setCharset() | Sets the character set of this message. | yii\swiftmailer\Message |
setFrom() | Sets the message sender. | yii\swiftmailer\Message |
setHtmlBody() | Sets message HTML content. | yii\swiftmailer\Message |
setReplyTo() | Sets the reply-to address of this message. | yii\swiftmailer\Message |
setSubject() | Sets the message subject. | yii\swiftmailer\Message |
setTextBody() | Sets message plain text content. | yii\swiftmailer\Message |
setTo() | Sets the message recipient(s). | yii\swiftmailer\Message |
toString() | Returns string representation of this message. | yii\swiftmailer\Message |
Protected Methods
Method | Description | Defined By |
---|---|---|
createSwiftMessage() | Creates the Swift email message instance. | yii\swiftmailer\Message |
setBody() | Sets the message body. | yii\swiftmailer\Message |
Property Details
The Bcc (hidden copy receiver) addresses of this message.
The Cc (additional copy receiver) addresses of this message.
The character set of this message.
The sender
Message HTML content.
The reply-to address of this message.
The message subject
Swift message instance.
Message plain text content.
The message recipients
Method Details
Attaches existing file to the email message.
$this attach( $fileName, array $options = [] ) | ||
$fileName | string | Full file name |
$options | array | Options for embed file. Valid options are:
|
return | $this | Self reference. |
---|
Attach specified content as file for the email message.
$this attachContent( $content, array $options = [] ) | ||
$content | string | Attachment file content. |
$options | array | Options for embed file. Valid options are:
|
return | $this | Self reference. |
---|
Creates the Swift email message instance.
\Swift_Message createSwiftMessage( ) | ||
return | \Swift_Message | Email message instance. |
---|
Attach a file and return it's CID source.
This method should be used when embedding images or other data in a message.
string embed( $fileName, array $options = [] ) | ||
$fileName | string | File name. |
$options | array | Options for embed file. Valid options are:
|
return | string | Attachment CID. |
---|
Attach a content as file and return it's CID source.
This method should be used when embedding images or other data in a message.
string embedContent( $content, array $options = [] ) | ||
$content | string | Attachment file content. |
$options | array | Options for embed file. Valid options are:
|
return | string | Attachment CID. |
---|
Returns the Bcc (hidden copy receiver) addresses of this message.
array getBcc( ) | ||
return | array | The Bcc (hidden copy receiver) addresses of this message. |
---|
Returns the Cc (additional copy receiver) addresses of this message.
array getCc( ) | ||
return | array | The Cc (additional copy receiver) addresses of this message. |
---|
Returns the character set of this message.
string getCharset( ) | ||
return | string | The character set of this message. |
---|
Returns the message sender.
string getFrom( ) | ||
return | string | The sender |
---|
Returns the reply-to address of this message.
string getReplyTo( ) | ||
return | string | The reply-to address of this message. |
---|
Returns the message subject.
string getSubject( ) | ||
return | string | The message subject |
---|
\Swift_Message getSwiftMessage( ) | ||
return | \Swift_Message | Swift message instance. |
---|
Returns the message recipient(s).
array getTo( ) | ||
return | array | The message recipients |
---|
Sets the Bcc (hidden copy receiver) addresses of this message.
$this setBcc( $bcc ) | ||
$bcc | string|array | Hidden copy receiver email address.
You may pass an array of addresses if multiple recipients should receive this message.
You may also specify receiver name in addition to email address using format:
|
return | $this | Self reference. |
---|
Sets the message body.
If body is already set and its content type matches given one, it will be overridden, if content type miss match the multipart message will be composed.
void setBody( $body, $contentType ) | ||
$body | string | Body content. |
$contentType | string | Body content type. |
Sets the Cc (additional copy receiver) addresses of this message.
$this setCc( $cc ) | ||
$cc | string|array | Copy receiver email address.
You may pass an array of addresses if multiple recipients should receive this message.
You may also specify receiver name in addition to email address using format:
|
return | $this | Self reference. |
---|
Sets the character set of this message.
$this setCharset( $charset ) | ||
$charset | string | Character set name. |
return | $this | Self reference. |
---|
Sets the message sender.
$this setFrom( $from ) | ||
$from | string|array | Sender email address.
You may pass an array of addresses if this message is from multiple people.
You may also specify sender name in addition to email address using format:
|
return | $this | Self reference. |
---|
Sets message HTML content.
$this setHtmlBody( $html ) | ||
$html | string | Message HTML content. |
return | $this | Self reference. |
---|
Sets the reply-to address of this message.
$this setReplyTo( $replyTo ) | ||
$replyTo | string|array | The reply-to address.
You may pass an array of addresses if this message should be replied to multiple people.
You may also specify reply-to name in addition to email address using format:
|
return | $this | Self reference. |
---|
Sets the message subject.
$this setSubject( $subject ) | ||
$subject | string | Message subject |
return | $this | Self reference. |
---|
Sets message plain text content.
$this setTextBody( $text ) | ||
$text | string | Message plain text content. |
return | $this | Self reference. |
---|
Sets the message recipient(s).
$this setTo( $to ) | ||
$to | string|array | Receiver email address.
You may pass an array of addresses if multiple recipients should receive this message.
You may also specify receiver name in addition to email address using format:
|
return | $this | Self reference. |
---|
Returns string representation of this message.
string toString( ) | ||
return | string | The string representation of this message. |
---|