diff --git a/src/Mail/Message.php b/src/Mail/Message.php index 57c42b3..139744d 100644 --- a/src/Mail/Message.php +++ b/src/Mail/Message.php @@ -397,6 +397,7 @@ protected function buildText(string $html): string ]); $text = Nette\Utils\Html::htmlToText($html); $text = Strings::replace($text, '#[ \t]+#', ' '); + $text = implode("\n", array_map('trim', explode("\n", $text))); return trim($text); } diff --git a/tests/Mail/Mail.HtmlBodyAndLinks.multiline.phpt b/tests/Mail/Mail.HtmlBodyAndLinks.multiline.phpt index ea0af43..9f927be 100644 --- a/tests/Mail/Mail.HtmlBodyAndLinks.multiline.phpt +++ b/tests/Mail/Mail.HtmlBodyAndLinks.multiline.phpt @@ -50,7 +50,7 @@ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Příliš žluťoučký - žlutý kůň +žlutý kůň ----------%S% Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit