Beispiel #1
0
 public function testMimeDocument()
 {
     $email = new SimpleEmail();
     $email->AddRecipient("*****@*****.**")->SetSubject("Testing")->SetSender("*****@*****.**")->SetText("This is test");
     $this->assertEquals(["Content-Type" => "text/plain; charset=utf-8", "From" => "*****@*****.**", "Subject" => "Testing"], $email->GetMailHeaders());
     $this->assertEquals("This is test", $email->GetBodyRaw());
     $email->SetHtml("<p>And some html too!</p>");
     $this->assertEquals(["MIME-Version" => "1.0", "Content-Type" => "multipart/alternative; boundary=\"972318020410491600659448730\"", "From" => "*****@*****.**", "Subject" => "Testing"], $email->GetMailHeaders());
     $this->assertEquals("--972318020410491600659448730\r\n" . "Content-Type: text/plain\r\n" . "Content-Transfer-Encoding: quoted-printable\r\n" . "\r\n" . "This is test\r\n" . "\r\n" . "--972318020410491600659448730\r\n" . "Content-Type: text/html\r\n" . "Content-Transfer-Encoding: quoted-printable\r\n" . "\r\n" . "<p>And some html too!</p>\r\n" . "--972318020410491600659448730--\r\n", $email->GetBodyRaw());
 }