我有一个表单,其中操作通过php文件然后传递到电子邮件地址。每次我使用有效的电子邮件地址提交表单时,请求都不会显示在网站管理员的电子邮件中,但如果是无效的电子邮件地址,例如dcfrd@jjj.com或dfjgv@gfds.fgr,则会直接反映到网站管理员。我不知道自己做错了什么。
$emailSubject = 'Enquery';
$webMaster = 'myemail@domain.com';`$name = $_POST ['name'];`$namibian = $_POST ['namibian'];`
$sadc = $_POST ['sadc'];
$other = $_POST ['other'];
$passport = $_POST ['passport'];
$address = $_POST ['address'];
$contact = $_POST ['contact'];
$mobile = $_POST ['mobile'];
$email = $_POST ['email'];
$adult = $_POST ['adult'];
$children = $_POST ['children'];
$vehicle = $_POST ['vehicle'];
$arrival_date = $_POST ['arrival_date'];
$departure_date = $_POST ['departure_date'];
$own_ablution = $_POST ['own_ablution'];
$luxury_site = $_POST ['luxury_site'];
$group_site = $_POST ['group_site'];
$enquiry = $_POST['enquiry'];
$cash = $_POST['cash'];
$eft = $_POST['eft'];
$paypal = $_POST['paypal'];
$body = <<<EOD
<br><hr><br>
Name: $name <br>
Namibian: $namibian <br>
SADC: $sadc <br>
Other: $other <br>
ID/Passport: $passport <br>
Address: $address <br>
Contact: $contact <br>
Mobile: $mobile <br>
Email: $email <br>
Adult: $adult <br>
Children: $children <br>
Nr Vehicle: $vehicle <br>
Arrival Date: $arrival_date <br>
Departure Date: $departure_date <br>
Own Ablution: $own_ablution <br>
Luxury Site: $luxury_site <br>
Group Site: $group_site <br>
Special Enquiry: $enquiry <br>
Cash: $cash <br>
EFT: $eft <br>
PayPal: $paypal <br>
EOD;
$headers = "From: $email\r\n";
$headers .= "Content-type: text/html\r\n";
$success = mail ($webMaster, $emailSubject, $body, $headers);
$theResults = <<<EOD
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Enquery Message</title>
<style type="text/css">
<!--
.formSite {
font-size: 14px;
font-weight: bold;
font-family:"Century Gothic", Arial, Helvetica, sans-serif;
}
body {
color: #0033CC;
}
-->
</style>
</head>
<body>
<div>
<div align="left" class="formSite" id="enquiry">Your booking went through. And We will get back to you shortly.<br> Thank you!</div>
</div>
</body>
</html>
EOD;
echo "$theResults";
感谢您的帮助