我使用以下脚本发送邮件
<?
extract($_POST);
$subject = "Feedback from ".$name." (".$email.", Ph: ".$phone.")";
$mail = @mail($send,$subject,$content);
if($mail) { echo "Your feedback has been sent"; }
else { echo "We are sorry for the inconvienience, but we could not send your feedback now."; }
?>
但这总是在垃圾邮件文件夹中结束。为什么呢?
答案 0 :(得分:0)
您必须在发送邮件时使用标题,以证明邮件来自真正的来源,而不是机器人。
试试这个!
<?
extract($_POST);
$subject = "Feedback from ".$name." (".$email.", Ph: ".$phone.")";
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From:'.$email."\r\n";
$headers .= 'Reply-To: '.$email;
$mail = @mail($feedback,$subject,$content,$headers);
if($mail) { echo "Your feedback is send"; }
else { echo "We are sorry for the inconvienience, but we could not send your feedback now."; }
?>