【发布时间】:2018-02-03 09:58:28
【问题描述】:
我有一个从 HTML 表单发送电子邮件的 PHP 页面。电子邮件已发送,但被 Hotmail 标记为垃圾邮件。我已经替换了代码中的实际电子邮件地址。
<?php
function clean_string($string){
$bad = array("content-type","bcc:","to:","cc:","href");
return str_replace($bad,"",$string);
}
$name=$_POST['name'];
$email=$_POST['email'];
$subj=$_POST['subject'];
$body=$_POST['body'];
$email_subject='Website name - '.$subj;
$email_message="<html><body><p>".clean_string($body)."</p><p>".$name."<br>".$email."</p></body></html>";
$headers[] = 'MIME-Version: 1.0';
$headers[] = 'Content-type: text/html; charset=iso-8859-1';
$headers[] = "From:email@email.com";
$headers[] = "Reply-To:".$name."<".$email.">";
$header=implode("\r\n",$headers);
if(mail('email@email.com',$email_subject,$email_message,$header)==true){header('location: http://julie-mosaics.dx.am/index.php?page=contact&result=success');} else {header('location: http://julie-mosaics.dx.am/index.php?page=contact&result=fail');}
?>
这是 hotmail 的错误信息。
Content analysis details: (7.1 points, 7.0 required)
pts rule name description
---- ---------------------- --------------------------------------------------
0.0 HTML_MESSAGE BODY: HTML included in message
1.1 MIME_HTML_ONLY BODY: Message only has text/html MIME parts
0.1 MISSING_MID Missing Message-Id: header
0.0 FROM_MISSP_DKIM From misspaced, DKIM dependable
1.4 MISSING_DATE Missing Date: header
2.5 FREEMAIL_FORGED_REPLYTO Freemail in Reply-To, but not From
2.0 FROM_12LTRDOM From a 12-letter domain
【问题讨论】:
-
添加 FROM:PersonName
-
你是怎么得到hotmail的错误信息的?