_createMessage(); $message->setSubject('just a test subject'); $message->setFrom(array( 'chris.corbyn@swiftmailer.org' => 'Chris Corbyn')); $id = $message->getId(); $date = $message->getDate(); $boundary = $message->getBoundary(); $message->addPart('foo', 'text/plain', 'iso-8859-1'); $message->addPart('test foo', 'text/html', 'iso-8859-1'); $this->assertEqual( 'Message-ID: <' . $id . '>' . "\r\n" . 'Date: ' . date('r', $date) . "\r\n" . 'Subject: just a test subject' . "\r\n" . 'From: Chris Corbyn ' . "\r\n" . 'MIME-Version: 1.0' . "\r\n" . 'Content-Type: multipart/alternative;' . "\r\n" . ' boundary="' . $boundary . '"' . "\r\n" . "\r\n\r\n" . '--' . $boundary . "\r\n" . 'Content-Type: text/plain; charset=iso-8859-1' . "\r\n" . 'Content-Transfer-Encoding: quoted-printable' . "\r\n" . "\r\n" . 'foo' . "\r\n\r\n" . '--' . $boundary . "\r\n" . 'Content-Type: text/html; charset=iso-8859-1' . "\r\n" . 'Content-Transfer-Encoding: quoted-printable' . "\r\n" . "\r\n" . 'test foo' . "\r\n\r\n" . '--' . $boundary . '--' . "\r\n", $message->toString() ); } // -- Private helpers protected function _createMessage() { Swift_DependencyContainer::getInstance() ->register('properties.charset')->asValue(null); return Swift_Message::newInstance(); } }