예제 #1
0
파일: MailTest.php 프로젝트: Kervinou/OBM
    public function test_recipients()
    {
        $message = <<<EOT
Date: Fri, 13 Feb 09 15:47:25 +0100
MIME-Version: 1.0
From: Foo Bar <*****@*****.**>
To: John Doe <*****@*****.**>
Cc: jane.doe@fake.net, =?UTF-8?Q?Rapha=C3=ABl=20Rougeron?= <*****@*****.**>
Bcc: bureaucratic.director@bigbrother.com
Subject: Stop these useless meetings...
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit

test
EOT;
        $mail = new SMail($this->date);
        $mail->set_from('*****@*****.**', 'Foo Bar');
        $mail->add_to('*****@*****.**', 'John Doe');
        $mail->add_cc('*****@*****.**');
        $mail->add_cc('*****@*****.**', 'Raphaël Rougeron'); // is the above encoded name correct ? not sure...
        $mail->add_bcc('*****@*****.**');
        $mail->set_subject('Stop these useless meetings...');
        $mail->set_text('test');
        $this->assertEquals($message, (string) $mail);
    }