Thread: formated mail
View Single Post
Old 04-06-2008, 01:32 PM   #4 (permalink)
etono
Moderator
 
Join Date: May 2006
Posts: 86
Default Re: formated mail

I am a little unsure about if you are trying to send the textarea input in an email or display it on a webpage, but line breaks in the textarea box are saved as "\n". If you want the line break in an email you may need to add a "\r", so run your message through str_replace function like this:

<?php
$_POST['message'] = str_replace("\n", "\n\r", $_POST['message']);
?>

If you want to display the message to a webpage then you can use the nl2br function like this:

<?php
echo nl2br($_POST['message']);
?>

Hope this helps.
__________________
Jeremy Moseley
My Links: Design Related Blog | Personal Website | Portfolio
etono is offline   Reply With Quote
Sponsored Links