I have the following form mail code (slightly amended for safety).
I added the lines (from http://php.net/manual/en/function.mail.php) to make the form send by HTML, but it doesn't work.
[CODE]$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";[/CODE]
Can someone suggest what is wrong, or what needs to be done?
<?php
if(isset($_POST['Submitted'])) {
$Errors = Array();
if(!trim($_POST['name'])) $Errors[] = "What is your name?";
if(!trim($_POST['comment'])) $Errors[] = "Please add some more comments";
if(!preg_match("/[a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9]{2,4}/",$_POST['email'])) $Errors[] = "please check your email address";
if(strtolower(trim($_POST['antispam'])) xxx";
if(!count($Errors)) {
$To .= 'To: Enquiries <xxx@xxx' ;
$Subject .= "Online Inquiry" . "\r\n";
$Indhold .= "Please reply to this online enquiry form as soon as possible:\r\n";
$Indhold .= "Subject: ".$_POST['subject']."\r\n";
$Indhold .= "Name: ".$_POST['name']."\r\n";
$Indhold .= "Phone: ".$_POST['phone']."\r\n";
$Indhold .= "Mobile: ".$_POST['mobile']."\r\n";
$Indhold .= "e-mail: ".$_POST['email']."\r\n";
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From: Enquiry <online@xxx' . "\r\n";
$headers .= "Reply-To: ". $_POST['email'] ." \r\n";
$headers .= "Bcc: xxx@hotmail.com\r\n";
$MailSuccess = mail($To, $Subject, $Indhold, $headers);
header("Location: thanks.php");
exit;
}
}