Originally posted by LordShryku
Maybe you want to tell us what this error says?
I basically just echo an error message if the mail wasn't sent properly. If I simply remove the \n the message sends fine. Here is the code in its entirety:
<?
$to = "myname@mydomain.com";
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: ".$_POST['email']."\r\n";
$msg = "This is a test\n";
$mail_sent = mail($to,$_POST['facility'], $msg, $headers);
if ($mail_sent) {
header ("Location: thanks.php");
} else {
echo "there was an error sending the email";
}
?>