protected function testMessage() { $mail = new Mail(new DateTime('2009-02-13 15:47:25', new DateTimeZone('Europe/Paris'))); $mail->addTo('*****@*****.**', 'John Doe'); $mail->setText('test'); return $mail; }
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 send(Mail $mail) { if (!isset($this->socket)) { $this->connect(); $this->helo(); } else { $this->rset(); } $this->mail($mail->getReturnPath()); foreach ($mail->getRecipients() as $recipient) { $this->rcpt($recipient); } return $this->data($mail->__toString()); }
public function testSend() { $mail = new Mail(); $mail->setFrom('root@localhost'); $mail->addTo('root@localhost', 'John Doe'); $mail->setText('test'); $mail->setHtmlText('<b>test</b>'); $this->assertTrue($mail->send($this->smtp)); }
public function testSend() { $message = <<<EOT Date: Fri, 13 Feb 09 15:47:25 +0100 MIME-Version: 1.0 To: John Doe <*****@*****.**> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit test EOT; $mail = new Mail($this->date); $mail->addTo('*****@*****.**', 'John Doe'); $mail->setText('test'); $this->assertEquals($message, $mail->send(new Transport\Dummy())); }
public function send(Mail $mail) { return $mail->__toString(); }