有人可以告诉我如何从联系表单正确发送邮件,以便收到我的收件箱而不是funk文件夹吗?
<?php
$EmailFrom = "myhost@email.nl";
$EmailTo = "myemail@address.com";
$Subject = "Mail via mydomain.nl";
$Name = Trim(stripslashes($_POST['Name']));
$Email = Trim(stripslashes($_POST['Email']));
$Message = Trim(stripslashes($_POST['Message']));
// validation
$validationOK=true;
if (!$validationOK) {
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
exit;
}
// prepare email body text
$Body = "";
$Body .= "Naam: ";
$Body .= $Name;
$Body .= "\n";
$Body .= "Bericht: ";
$Body .= $Message;
$Body .= "\n";
// send email
$success = mail($EmailTo, $Subject, $Body, "From: <$Email>");
// redirect to success page
if ($success){
print "<meta http-equiv=\"refresh\" content=\"0;URL=contactthanks.php\">";
}
else{
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
}
?>
这是我到目前为止的代码。 它修剪&#39;来自HTML的输入,将其抛出在$ body变量中。
如何使邮件对我的收件箱安全? $头? :)