Example #1
0
 public function sendEmailBySmtp($from, $to, $subject, $body)
 {
     $this->_createSmtpClient();
     $message = new Message();
     $message->setFrom($from, $from);
     $message->setTo($to, $to);
     $message->setSubject($subject);
     $message->setBody($body);
     $this->client->send($message);
 }
 public function testSendEmailBySmtp()
 {
     $this->client->shouldReceive('send')->with(m::on(function ($value) {
         $message = new Message();
         $message->setFrom("*****@*****.**", "*****@*****.**");
         $message->setTo("*****@*****.**", "*****@*****.**");
         $message->setSubject("Foo");
         $message->setBody("Bar");
         return $message == $value;
     }));
     $this->module->sendEmailBySmtp("*****@*****.**", "*****@*****.**", "Foo", "Bar");
 }
Example #3
0
 /**
  * set mail subject
  * @param string $subject
  * @return $this
  */
 public function setSubject($subject)
 {
     $this->message->setSubject($subject);
     return $this;
 }