New line in email and SMS body


I usually use <br> to insert new lines in my email body but this time I need to send the same message as both email and SMS. I used \r\n in double quotes as suggested somewhere but it didn’t create new lines in received email.

For example, the following code did not create new lines in the email body.

$body = "New form submitted.\r\n
Name: $name\r\n
Time: $time";

Any ideas what to use that will create new lines in both email and SMS body?


EDIT: It looks I needed to use text/plain as content type for \r\n to work. Issue solved.

1 Like

Or you can try this function -

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.