Пример #1
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));
 }
Пример #2
0
    public function testHtmlMessage()
    {
        $message = <<<EOT
Date: Fri, 13 Feb 09 15:47:25 +0100
MIME-Version: 1.0
From: Foo Bar <*****@*****.**>
To: John Doe <*****@*****.**>
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: 8bit

<b>test</b>
EOT;
        $mail = new Mail($this->date);
        $mail->setFrom('*****@*****.**', 'Foo Bar');
        $mail->addTo('*****@*****.**', 'John Doe');
        $mail->setHtmlText('<b>test</b>');
        $this->assertEquals($message, (string) $mail);
    }