Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHPMailer - how can I add break lines in altbody?

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?

like image 959
Thomas Hardy Avatar asked Mar 05 '12 06:03

Thomas Hardy


1 Answers

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

like image 98
Philipp Kyeck Avatar answered Oct 19 '22 07:10

Philipp Kyeck