line breaks in email text messages
| From: | Michael Collins | Date: | Tue, 14 Sep 2004 01:11:27 +0000 |
| Subject: | line breaks in email text messages | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-196584@lists.php.net to get a copy of this message | ||
How do I preserve line breaks in the body of an email message? The email message is plain text and I simply want to have a return included between each element entered into a form. I have used \n or \r\n (since this is a Windows server) to no avail. The email message I get back has all the data, but no line breaks. Any hints?
$emailbody = 'Sent by: '.$_POST['name'];
$emailbody .= "\nEmail: ".$email_from;
if(isset($_POST['company'])){
$emailbody .= "\nCompany: ".$_POST['company'];
}
if(isset($_POST['address'])){
$emailbody .= "\nAddress: ".$_POST['address'];
}
... etc ...
mail($email_to,$email_subject,$emailbody,$header)
--
Michael
__
||| Michael Collins
||| Kuwago Inc
||| Singapore and Seattle USA