コード例 #1
0
ファイル: user_mailer.php プロジェクト: vincenta/stato
 protected function forgotPasswordMessage($user)
 {
     $mail = new Mail();
     $mail->addTo($user->mail, $user->name);
     $mail->setHtmlText($this->render('forgot_password.html', array('username' => $user->name)));
     return $mail;
 }
コード例 #2
0
ファイル: SmtpTest.php プロジェクト: vincenta/stato
 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));
 }
コード例 #3
0
ファイル: MailTest.php プロジェクト: vincenta/stato
    public function testAutomaticMultipartMessage()
    {
        $message = <<<EOT
Date: Fri, 13 Feb 09 15:47:25 +0100
MIME-Version: 1.0
To: John Doe <*****@*****.**>
Content-Type: multipart/alternative; boundary="c67476988f320ca04d61815bcfd14360"

This is a multi-part message in MIME format.
--c67476988f320ca04d61815bcfd14360
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit

test
--c67476988f320ca04d61815bcfd14360
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: 8bit

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