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'); } }
public function testMessageWithoutAToShouldThrow() { $mail = new Mail($this->date); $this->setExpectedException('Stato\\Mailer\\Exception', 'To: recipient is not specified'); $mail->getTo(); }