flemingmike Posted December 1, 2010 Share Posted December 1, 2010 hello, is there a way to have it so that when somebody enters information into a textbox in a form, it will keep the formatting (if they have 5 lines, it will show as 5, not 1) $name = $_POST['name']; $resume = $_POST['resume']; $to = "mike@web.com"; $subject = "Resume From Website"; $message = "Name: $name <br /> Resume: $resume "; $from = "resume@web.com"; $headers = "From: $from \r\n Content-Type: text/html; charset=ISO_8859-1\r\n Content-Transfer_Encoding: 7bit\r\n\r\n"; mail($to,$subject,$message,$headers); Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted December 1, 2010 Share Posted December 1, 2010 Since you are sending a HTML email message, you need to use the function nl2br to display everything correctly. <?php $name = $_POST['name']; $resume = nl2br($_POST['resume']); $to = "mike@web.com"; $subject = "Resume From Website"; $message = "Name: $name <br /> Resume: $resume "; $from = "resume@web.com"; $headers = "From: $from \r\n Content-Type: text/html; charset=ISO_8859-1\r\n Content-Transfer_Encoding: 7bit\r\n\r\n"; mail($to,$subject,$message,$headers); ?> Ken Quote Link to comment Share on other sites More sharing options...
flemingmike Posted December 1, 2010 Author Share Posted December 1, 2010 perfect. thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.