Esempio n. 1
0
 public function testMessageWithoutAContentShouldThrow()
 {
     $mail = new Mail($this->date);
     $mail->addTo('*****@*****.**', 'John Doe');
     $this->setExpectedException('Stato\\Mailer\\Exception', 'No body specified');
     $mail->getContent();
 }
Esempio n. 2
0
 public function send(Mail $mail)
 {
     $to = $mail->getTo();
     $subject = $mail->getSubject();
     $result = mail($to, $subject, $mail->getContent(), $mail->getNonMatchingHeaderLines(array('To', 'Subject')));
     if (!$result) {
         throw new Exception('Unable to send mail');
     }
 }