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<info@asdf.com>\r\n";
$headers .= 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
mail("aas@asdf.com","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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.