Forum Moderators: coopster

Message Too Old, No Replies

Php email form

         

adammc

1:17 am on Aug 7, 2006 (gmt 0)

10+ Year Member



Hi folks,

I'm having a strange problem with the code below, I am trying to get it to place 3 line breaks after the $message (so i can then display: sent by: $name - $from) but it wont even break a single line?

[php]
$body="$message\n\n\n sent by: $name - $from";
$from="\"$name\" <$from>\n";
$headers="Content-Type: text/html; charset=Windows-1252\n";
$headers.="From: $from \n";

mail($to,$subject,$body,$headers);

[/php]

Any advice would be greatly appreciated.

barns101

10:23 am on Aug 7, 2006 (gmt 0)

10+ Year Member



The breaks will be there if you check the source of the email, but as you have formatted the message in HTML you will need to use <br> instead.