- <?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 '';
- }
- }
- }
|