Please anyone refer this code and correct it for me. I have used this code in another webpage it is working, but now this script is not sending the message, it show my custom error message.
Could you please any one help me to find the problem
Thank you
<?php
/* for admin */
$registration_subject="Live demo registration";
$registration_office="[email protected]";
/* REGISTER details */
$bizname = $_POST['txtbizname'];
$biztype = $_POST['cbobiztype'];
$address = $_POST['TxtAddress'];
$city = $_POST['TxtCity'];
$country = $_POST['cboCountry'];
$tel = $_POST['TxtTel'];
$fax = $_POST['TxtFax'];
$email = $_POST['TxtEmail'];
$web = $_POST['TxtWeb'];
$title = $_POST['Cbotitle'];
$contname = $_POST['txtcontname'];
$designation = $_POST['TxtDesignation'];
$mob = $_POST['TxtMob'];
$contemail = $_POST['TxtcontEmail'];
$callbiztime = $_POST['BizGMT'];
$body = <<<EOD
Business Name : $bizname <br>
Business Type : $biztype <br>
Address : $address <br>
City : $city <br>
Country : $country <br>
Tel : $tel <br>
Fax : $fax <br>
Email : $email <br>
Web : $web <br>
Title : $title <br>
Contact Person Name : $contname <br>
Designation : $designation <br>
Mobile : $mob <br>
Email : $contemail <br>
Call Me at : $callbiztime <br>
EOD;
$headers = "From : $email\r\n";
$headers = "Content-type:text/html\r\n";
$mail_status = mail($registration_office, $registration_subject, $body, $headers);
if ($mail_status) { ?>
<script language="javascript" type="text/javascript">
alert('Thank you for the message. We will contact you shortly.');
window.location = 'b2b.html';
</script>
<?php
}
else { ?>
<script language="javascript" type="text/javascript">
alert('Message failed. Please, send an email to [email protected]');
windowwindow.location = 'b2b.html';
</script>
<?php
}
?>
Message failed. Please, send an ....
message? Or what "custom error message" do you mean? – sebastian 5 hours ago$headers .= "Content-type:text/html\r\n";
- Notice the missing dot? – Fred 2 hours ago