我有问题。 当我点击提交所有细节时,我寄了mail,但问题是:我收到2份电子邮件、1份在我的盒子里、1份在我的间谍。
我确实不知道我对我的法典有什么错误。
任何建议都将受到高度赞赏。
这里是我的派任守则。
<?php
// get posted data into local variables
$EmailFrom = "webmaster";
$EmailTo = "[email protected]";
$Subject = "Contact us";
$name = $_POST[ name ];
$address=$_POST[ address ];
$month =$_POST[ month ];
$day =$_POST[ day ];
$year =$_POST[ year ];
$home =$_POST[ home ];
$mobile =$_POST[ mobile ];
$contact =$_POST[ contact ];
$relationship =$_POST[ relationship ];
$course =$_POST[ course ];
$hours =$_POST[ hours ];
// prepare email body text
$Body = "";
$Body .= "Name: ";
$Body .= $name;
$Body .= "
";
$Body .= "Address: ";
$Body .= $address;
$Body .= "
";
$Body .= "Month: ";
$Body .= $month;
$Body .= "
";
$Body .= "Day: ";
$Body .= $day;
$Body .= "
";
$Body .= "Year: ";
$Body .= $year;
$Body .= "
";
$Body .= "Home No.: ";
$Body .= $home;
$Body .= "
";
$Body .= "Mobile: ";
$Body .= $mobile;
$Body .= "
";
$Body .= "Contact Person: ";
$Body .= $contact;
$Body .= "
";
$Body .= "Relationship: ";
$Body .= $relationship;
$Body .= "
";
$Body .= "Course: ";
$Body .= $course;
$Body .= "
";
$Body .= "Hours: ";
$Body .= $hours;
$Body .= "
";
$headers = "From: ".$EmailFrom."" ;
// send email
$success = mail($EmailTo, $Subject, $Body, $headers);
// redirect to success page
if (mail($EmailTo, $Subject, $Body, $headers)){
header( "Location: application.php" );
}
?>