I am trying to send a message using PHPs mail library called Swiftmailer. The problem is that the text is rendered without line breaks and I can’t really see the reason for that. I’ve tried reading the mail using gmail and yahoo.
The code:
// [..] bla bla
$message->setBody("a\r\nb", 'text/plain')
HTML doesn’t obey line breaks (they’re treated as spaces). You need to use
<br />tags instead. If you’re filling in plaintext dynamically, you can use PHP’snl2br()to do this for you.