mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-30 22:48:19 +08:00
Email message charset setup added.
This commit is contained in:
@@ -39,6 +39,22 @@ class Message extends BaseMessage
|
|||||||
return $this->_swiftMessage;
|
return $this->_swiftMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @inheritdoc
|
||||||
|
*/
|
||||||
|
public function setCharset($charset)
|
||||||
|
{
|
||||||
|
$this->getSwiftMessage()->setCharset($charset);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return string the character set of this message.
|
||||||
|
*/
|
||||||
|
public function getCharset()
|
||||||
|
{
|
||||||
|
return $this->getSwiftMessage()->getCharset();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritdoc
|
* @inheritdoc
|
||||||
*/
|
*/
|
||||||
@@ -232,8 +248,8 @@ class Message extends BaseMessage
|
|||||||
{
|
{
|
||||||
$embedFile = \Swift_EmbeddedFile::newInstance($content);
|
$embedFile = \Swift_EmbeddedFile::newInstance($content);
|
||||||
if (!empty($options['fileName'])) {
|
if (!empty($options['fileName'])) {
|
||||||
$embedFile->setFilename($options['fileName']);
|
$embedFile->setFilename($options['fileName']);
|
||||||
}
|
}
|
||||||
if (!empty($options['contentType'])) {
|
if (!empty($options['contentType'])) {
|
||||||
$embedFile->setContentType($options['contentType']);
|
$embedFile->setContentType($options['contentType']);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ use Yii;
|
|||||||
* @see BaseMailer
|
* @see BaseMailer
|
||||||
*
|
*
|
||||||
* @property \yii\mail\BaseMailer $mailer mailer component instance. This property is read-only.
|
* @property \yii\mail\BaseMailer $mailer mailer component instance. This property is read-only.
|
||||||
|
* @property string $charset the character set of this message.
|
||||||
* @property string|array $from sender email address.
|
* @property string|array $from sender email address.
|
||||||
* @property string|array $to receiver email address.
|
* @property string|array $to receiver email address.
|
||||||
* @property string|array $cc copy receiver email address.
|
* @property string|array $cc copy receiver email address.
|
||||||
|
|||||||
@@ -15,6 +15,12 @@ namespace yii\mail;
|
|||||||
*/
|
*/
|
||||||
interface MessageInterface
|
interface MessageInterface
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* Set the character set of this message.
|
||||||
|
* @param string $charset character set name.
|
||||||
|
*/
|
||||||
|
public function setCharset($charset);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets message sender.
|
* Sets message sender.
|
||||||
* @param string|array $from sender email address.
|
* @param string|array $from sender email address.
|
||||||
|
|||||||
@@ -168,6 +168,8 @@ class Message extends BaseMessage
|
|||||||
public $id;
|
public $id;
|
||||||
public $encoding;
|
public $encoding;
|
||||||
|
|
||||||
|
public function setCharset($charset) {}
|
||||||
|
|
||||||
public function setFrom($from) {}
|
public function setFrom($from) {}
|
||||||
|
|
||||||
public function setTo($to) {}
|
public function setTo($to) {}
|
||||||
|
|||||||
Reference in New Issue
Block a user