PHPMailer - how can I add break lines in altbody?

Thomas Hardy picture Thomas Hardy · Mar 5, 2012 · Viewed 15.7k times · Source

How can I add break lines?

I'm using this:

$mailbody=$username."\r\n";
$mailbody.=$email."\r\n";

$altbody=$username."\r\n";
$altbody.=$email."\r\n";

But break lines are not there.

I'm using $altbody because for some reason the software I use to receive the emails does not read HTML, only plain text, so, $altbody is the body when the email reader does not support HTML, so, I can't use BR neither...

Any ideas?

Answer

pkyeck picture pkyeck · Mar 5, 2012

normally linebreaks with only \n should work in plain text emails.
but stick to the <br/>s in your html-mail $mailbody.