Ejemplo n.º 1
0
 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;
 }
Ejemplo 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');
     }
 }
Ejemplo n.º 3
0
 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());
 }
Ejemplo n.º 4
0
 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));
 }
Ejemplo n.º 5
0
    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()));
    }
Ejemplo n.º 6
0
 public function send(Mail $mail)
 {
     return $mail->__toString();
 }