Email Template in PHP

100 Views Asked by At

I am trying to add paragraph in email template but not getting it done as I get confused because nl2br is not working in email template

Should I use \r\n and where to write it?

'email-message' => $data['mail-message'] 
1

There are 1 best solutions below

1
On

There can be reason of content-type behind this issue. You need to use a <br> if your content-type is text/html. content-type header is must otherwise your e-mail will be interpreted an plain text. In case If you want to use \n you should use content-type: text/plain but then you will lose any markup. So better to use content-type as text/html and use <br>.