public function testMessageWithoutAContentShouldThrow() { $mail = new Mail($this->date); $mail->addTo('*****@*****.**', 'John Doe'); $this->setExpectedException('Stato\\Mailer\\Exception', 'No body specified'); $mail->getContent(); }
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'); } }