Pagekit\Mail\Message::setMailer PHP Method

setMailer() public method

public setMailer ( Pagekit\Mail\MailerInterface $mailer )
$mailer Pagekit\Mail\MailerInterface
    public function setMailer(MailerInterface $mailer)
    {
        $this->mailer = $mailer;
        return $this;
    }

Usage Example

示例#1
0
 /**
  * {@inheritdoc}
  */
 public function create($subject = null, $body = null, $to = null, $from = null)
 {
     $message = new Message($subject, $body);
     if ($to !== null) {
         $message->setTo($to);
     }
     if ($from !== null) {
         $message->setFrom($from);
     }
     return $message->setMailer($this);
 }