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; }
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 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); }