It is changing any ' or " in the email recieved to \' or \" -- I was looking online and I saw something about stripslashes... But I dont understand how this works exactly? All the examples I saw were using HTML, but my email sends as plain text 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.com"; // 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/plain; charset=iso-8859-1\r\n";
$headers .= "Content-type: text/plain; charset=UTF-8\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,";
$email_message .= "\n\nPolicy Number: " .$policynumber;
$email_message .= "\nClients Name: " .$name;
$email_message .= "\nPhone Number: " .$phonenumber;
$email_message .= "\nReason(s): " .$issue;
$email_message .= "\nPurchased Already: " .$purchased;
$email_message .= "\nAll info correct?: " .$infocheck;
$email_message .= "\n\nAdditional Information: " .$additionalinfo;
"\n\n\n\n". // Message that the email has in it
//$headers = "From: ".$email_from;
$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=\"#\" onclick=\"history.back();\">here</a> to go back</center>";
} else {
die("Sorry but the email could not be sent. Please go back and try again!");
}
?>