public function testQuotedPrintable() { $document = MimeDocument::fromString($this->message2); $part = $document->getParts()[0]; $text = $part->getTransformedBody(); $this->assertEquals('<b:Sources SelectedStyle="\\APASixthEditionOfficeOnline.xsl" StyleName="APA" Version="6" xmlns:b="http://schemas.openxmlformats.org/officeDocument/2006/bibliography" xmlns="http://schemas.openxmlformats.org/officeDocument/2006/bibliography"></b:Sources>', $text); $part->setTransformedBody("aSDF====rasdfasdfxcv asdf asdf werqwerqsedfasdfasd fasdfasdf asdf asdfasdfas dfasdf asdf a\r\n" . "zxcvasedrf\r\n" . "2q34r2\r\n" . "423423"); $this->assertEquals("aSDF=3D=3D=3D=3Drasdfasdfxcv asdf asdf werqwerqsedfasdfasd fasdfasdf asdf a=\r\n" . "sdfasdfas dfasdf asdf a\r\n" . "zxcvasedrf\r\n" . "2q34r2\r\n" . "423423", $part->getRawBody()); }
/** * Returns the mail headers as an array of key value pairs. * * @return array */ public function getMailHeaders() { $headers = []; $html = $this->getHtml(); $text = $this->getText(); $subject = $this->getSubject(); if ($html != "" || count($this->attachments) > 0) { $mime = new MimeDocument("multipart/alternative", crc32($html) . crc32($text) . crc32($subject)); $headers = $mime->getHeaders(); } else { $headers["Content-Type"] = "text/plain; charset=utf-8"; } $headers["From"] = (string) $this->getSender(); $headers["Subject"] = $subject; return $headers; }