|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- <?php
-
-
- namespace yii\mail;
-
- use yii\base\ErrorHandler;
- use yii\base\Object;
- use Yii;
-
-
- abstract class BaseMessage extends Object implements MessageInterface
- {
-
-
- public $mailer;
-
-
-
-
- public function send(MailerInterface $mailer = null)
- {
- if ($mailer === null && $this->mailer === null) {
- $mailer = Yii::$app->getMailer();
- } elseif ($mailer === null) {
- $mailer = $this->mailer;
- }
- return $mailer->send($this);
- }
-
-
-
- public function __toString()
- {
-
-
- try {
- return $this->toString();
- } catch (\Exception $e) {
- ErrorHandler::convertExceptionToError($e);
- return '';
- }
- }
- }
|