1

I'm trying to insert a new line in message body using \n but it's not working. Tried already with \r\n and it doesn't work also.

Any help?

Tks.

2 Answers 2

5

Could be a couple things, without seeing any of your code it's difficult to help you.

Try:

  1. Making sure you're using double quotes (") instead of single quotes (') around the new line characters. (This is because PHP does not interpolate strings defined by single quotes).
  2. Setting the Content-Type to text/plain in the mail headers. (If you need HTML in your email, use <br /> for new lines).

Also, you should always use \r\n with emails so the new line is recognized across all platforms.

1

Are using double quotes? They are necessary for the special characters to be interpreted correctly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.