tags:

views:

23

answers:

1

I'm using the following to send an email:

<php ....
$message = 'Hi '.$fname.', \r\n Your entries for the week of '
   .$weekof.' have been reviewed. \r\n Please login and View Weekly reports to see the report and comments. \r\n Thanks, \r\n'.$myname;

mail($to, $subject, $message, $from);
?>

When the message is received it does not start a new line at the "\r\n" but just prints them as part of the message.

I only tried it in Thunderbird 3, not any other clients.

+5  A: 

Try to change your ' to " - php interprets a string inside single quotes as literals, whereas with quotes (") it will expand the \r\n to what you want.

More information: http://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.single

Oren
Thanks. This did the trick. I didn't know there was a difference between single and double quotes.
ChuckO