Class yii\swiftmailer\Message
Inheritance | yii\swiftmailer\Message » yii\mail\BaseMessage |
---|---|
Available since version | 2.0 |
Message implements a message class based on SwiftMailer.
See also:
Public Methods
Protected Methods
Method | Description | Defined By |
---|---|---|
createSwiftMessage() | Creates the Swift email message instance. | yii\swiftmailer\Message |
createSwiftSigner() | Creates signer from its configuration | yii\swiftmailer\Message |
setBody() | Sets the message body. | yii\swiftmailer\Message |
Method Details
This method is called after the object is created by cloning an existing one.
It ensures \yii\swiftmailer\swiftMessage is also cloned.
public void __clone ( ) |
Adds custom header value to the message.
Several invocations of this method with the same name will add multiple header values.
public $this addHeader ( $name, $value ) | ||
$name | string | Header name. |
$value | string | Header value. |
return | $this | Self reference. |
---|
Adds message signature.
public $this addSignature ( $signature ) | ||
$signature | array|callable|\Swift_Signer | Signature specification, this can be:
|
return | $this | Self reference |
---|---|---|
throws | \yii\base\InvalidConfigException | on invalid signature configuration |
public void attach ( $fileName, array $options = [] ) | ||
$fileName | ||
$options |
public void attachContent ( $content, array $options = [] ) | ||
$content | ||
$options |
Creates the Swift email message instance.
protected \Swift_Message createSwiftMessage ( ) | ||
return | \Swift_Message | Email message instance. |
---|
Creates signer from its configuration
protected \Swift_Signer createSwiftSigner ( $signature ) | ||
$signature | array | Signature configuration |
return | \Swift_Signer | Signer instance |
---|---|---|
throws | \yii\base\InvalidConfigException | on invalid configuration provided |
public void embed ( $fileName, array $options = [] ) | ||
$fileName | ||
$options |
public void embedContent ( $content, array $options = [] ) | ||
$content | ||
$options |
public void getBcc ( ) |
public void getCc ( ) |
public void getCharset ( ) |
public void getFrom ( ) |
Returns all values for the specified header.
public array getHeader ( $name ) | ||
$name | string | Header name. |
return | array | Header values list. |
---|
Returns the priority of this message.
public integer getPriority ( ) | ||
return | integer | Priority value as integer in range: |
---|
Get the addresses to which a read-receipt will be sent.
public string getReadReceiptTo ( ) | ||
return | string | Receipt receive email addresses. |
---|
public void getReplyTo ( ) |
Returns the return-path (the bounce address) of this message.
public string getReturnPath ( ) | ||
return | string | The bounce email address. |
---|
public void getSubject ( ) |
public \Swift_Message getSwiftMessage ( ) | ||
return | \Swift_Message | Swift message instance. |
---|
public void getTo ( ) |
public void setBcc ( $bcc ) | ||
$bcc |
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.
protected void setBody ( $body, $contentType ) | ||
$body | string | Body content. |
$contentType | string | Body content type. |
public void setCc ( $cc ) | ||
$cc |
public void setCharset ( $charset ) | ||
$charset |
public void setFrom ( $from ) | ||
$from |
Sets custom header value to the message.
public $this setHeader ( $name, $value ) | ||
$name | string | Header name. |
$value | string|array | Header value or values. |
return | $this | Self reference. |
---|
Sets custom header values to the message.
public $this setHeaders ( $headers ) | ||
$headers | array | Headers in format: |
return | $this | Self reference. |
---|
public void setHtmlBody ( $html ) | ||
$html |
Set the priority of this message.
public $this setPriority ( $priority ) | ||
$priority | integer | Priority value, should be an integer in range: |
return | $this | Self reference. |
---|
Sets the ask for a delivery receipt from the recipient to be sent to $addresses.
public $this setReadReceiptTo ( $addresses ) | ||
$addresses | string|array | Receipt receive email address(es). |
return | $this | Self reference. |
---|
public void setReplyTo ( $replyTo ) | ||
$replyTo |
Set the return-path (the bounce address) of this message.
public $this setReturnPath ( $address ) | ||
$address | string | The bounce email address. |
return | $this | Self reference. |
---|
Sets message signature
public $this setSignature ( $signature ) | ||
$signature | array|callable|\Swift_Signer | Signature specification. See addSignature() for details on how it should be specified. |
return | $this | Self reference. |
---|
public void setSubject ( $subject ) | ||
$subject |
public void setTextBody ( $text ) | ||
$text |
public void setTo ( $to ) | ||
$to |
public void toString ( ) |