Jump to content

[SOLVED] Add Line Breaks Function??


signature16

Recommended Posts

I have a page with a single textbox and submit button.  When the page is processed on itself, it emails somebody the response.

 

When I get the email response, the message submited doesn't include line breaks.  How do I add line breaks?

 

You can see in the code below that when $message (its inside $message1) is displayed, it doesn't add the appropriate line breaks if there should be line breaks there.  How can I fix that?

 


<?php
$submit = $_POST['submit'];
$message = $_POST['message'];
if( isset($submit) ) {

$message1 = "<table width=\"500\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" align=\"center\" style=\"border:1px solid #CCCCCC;\"><tbody><tr>
  <td><img src=\"http://www.theprrt.com/images/email/default-superspine-header.gif\" /></td>
</tr><tr><td style=\"padding: 20px 30px; font-size: 10pt; font-family: Arial,Helvetica,sans-serif; line-height: 1.3em; text-align: justify\">
    <p> $message </p></td></tr><tr><td><br>
<img alt=\"\" src=\"http://www.theprrt.com/images/email/email-footer.gif\"></td></tr></tbody></table>
";


$headers  = "From: asdf<[email protected]>\r\n";
$headers .= 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
mail("[email protected]","Feedback Question 1",$message1,$headers);
echo "Thank you for the feedback.  If you requested a reply, we will get back to you as soon as possible.";
echo "<br />";
echo "$message<br />";
}
else{
?>

Link to comment
https://forums.phpfreaks.com/topic/72521-solved-add-line-breaks-function/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.