Adding line feed or br in a str

Running out of hair - please help.

What is the proper syntax to get a line feed in the resulting email that $strMessage is passed to ? I just can not get it to work !

$strMessage = "Content: ".$_POST["txtfname"]." \\n ".$_POST["txtlname"]." \\n ".$_POST["txtDescription"]." ";

The email gets sent fine but everything is all on one line.
It should be \n
not \\n
I had already tried your suggestion but just be sure I tried it again but the email sends fine but there are no LFs CRs in it. All the fields print on the same line.

Code is now: $strMessage="Content: ".$_POST["txtfname"]." \n ".$_POST["txtlname"]." \n ".$_POST["txtDescription"]." ";

I have tried "\n"and that throws an error. What really puzzles me is there are no syntax errors but the code does NOT produce the desired results.

i.e Actual Results = John Doe Description

Desired Results:

etc ...
etc ...

Can it be the position of the \n ? I've tried several different placements but keep getting syntax errors.
Can it be forced with 'hidden' fields in the table that contain a <br /> or <p /> ?
If you are sending text based email then \n will work , but if you are sending html emails then you have to use line break tag <br>.

If you are sending any user data then you can use nl2br function to add line breaks for every carriage return and line breaks added by user.
Please Login to post your reply or start a new topic