diff --git a/src/Message.php b/src/Message.php index e16c2438..f83c2961 100644 --- a/src/Message.php +++ b/src/Message.php @@ -551,7 +551,7 @@ public static function fromString($rawMessage) $message = new static(); $headers = null; $content = null; - Mime\Decode::splitMessage($rawMessage, $headers, $content); + Mime\Decode::splitMessage($rawMessage, $headers, $content, Headers::EOL); if ($headers->has('mime-version')) { // todo - restore body to mime\message } diff --git a/test/MessageTest.php b/test/MessageTest.php index a0ccff1e..0b65d9f1 100644 --- a/test/MessageTest.php +++ b/test/MessageTest.php @@ -688,7 +688,7 @@ public function testRestoreFromSerializedString() $this->message->addFrom('matthew@example.com', "Matthew Weier O'Phinney"); $this->message->addCc('zf-contributors@example.com', 'ZF Contributors List'); $this->message->setSubject('This is a subject'); - $this->message->setBody('foo'); + $this->message->setBody("foo\n\ntest"); $serialized = $this->message->toString(); $restoredMessage = Message::fromString($serialized); $this->assertEquals($serialized, $restoredMessage->toString());