So, this is probably something really stupid that I cant find... But... I have a text box...
<textarea name="additionalinfo" id="additionalinfo" cols="55" rows="6"></textarea>
But when the mail shows up, any hard returns just show up on a single line... Basically, its not creating a <p>
example, if you type in...
It will output to the email address in my form...
How do I set myself up so that it will turn my hard returns into <p> for the html?
Here is what I have currently...
<?php
//$name = $_POST["email"];
$name = $_POST["name"];
$policynumber = $_POST["policynumber"];
$phonenumber = $_POST["phonenumber"];
$issue = $_POST["issue"];
$purchased = $_POST ["purchased"];
$infocheck = $_POST ["infocheck"];
$additionalinfo = $_POST ["additionalinfo"];
//checkbox value readout
$mailcc = $_POST['sendmetoo'];
$email_to = "xxx@xxx"; // Who the email is to
$email_from = $_POST['emailfrom']; // Who the email is from
$email_subject = $policynumber.' - '.$issue; // The Subject of the email
//here you can define whatever you want to...
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "To: <".$email_to.">\r\n";
$headers .= "From: ".$email_from."\r\n";
//we control if sendmetoo is checked...
if($mailcc == 'sendtome'){
$headers .= "Cc: ".$email_from."\r\n";
}
//$headers .= "Bcc: noone@nowhere.com\r\n";
$email_message = "Sales Level 2,<p>";
$email_message .= "\n\n<b>Policy Number:</b> " .$policynumber. "<br>";
$email_message .= "\n<b>Clients Name:</b> " .$name. "<br>";
$email_message .= "\n<b>Phone Number:</b> " .$phonenumber. "<br>";
$email_message .= "\n<b>Reason(s):</b> " .$issue. "<br>";
$email_message .= "\n<b>Purchased Already:</b> " .$purchased. "<br>";
$email_message .= "\n<b>All info correct?:</b> " .$infocheck. "<p>";
$email_message .= "\n\n<b>Additional Information:</b> " .$additionalinfo. "<br>";
$from_domain = strtolower(strrchr($email_from, '@'));if($from_domain!='@xxx.com' && $from_domain!='@xxx.com'){ echo "<center><font size=+2>Your email has <u><b>NOT</b></u> been sent</font><p>That email address is not allowed.<br>Click <a href=\"#\" onclick=\"history.back();\">here</a> to go back</center>"; exit();}
$ok = @mail($email_to, $email_subject, $email_message, $headers);
if($ok) {
echo "<font face=verdana size=2><center>Your message has been sent<br>
to Sales Level 2<br>
Click <a href=saleslevel2mailer.php>here</a> to go back</center>";
} else {
die("Sorry but the email could not be sent. Please go back and try again!");
}
?>
Thanks in advance guys!
🙂