<?php // The message $message = "Line 1\nLine 2\nLine 3"; // Send mail('firstname.lastname@example.org', 'My Subject', $message); ?>but when I test with an echo statement like this:-
<?php $message = "Line 1\nLine 2\nLine 3"; echo "$message"; ?>in WampServer2 there aren't any line breaks. Why Not? Has php.net given a wrong example? How can I get \n or \r\n to create a line break from a variable?
I really want to concatenate several variables like:-
$name = "Name"; $email = "Email"; $message = "Message"; $messagebody = $name . "\r\n" . $email . "\r\n" . $message; echo "$messagebody";but there aren't any line breaks, it's all on one line. How do I make \r\n work?