我想用PHP发送电子邮件。PHP发送电子邮件GMAIL错误
public function email($to, $title, $message){
$from = "[email protected]";
$headers = "From: {$from}\r\n";
$headers .= "X-Confirm-Reading-To: {$from}\r\n";
$headers .= "Reply-To: {$from}\r\n";
$headers .= "Organization: InfiniSys, inc.\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=ISO-8859-1\r\n";
$headers .= "X-Priority: 3\r\n";
$headers .= "X-Mailer: PHP". phpversion() ."\r\n";
$subject = $title;
mail($to, $subject, $message, $headers);
}
消息发送;但是,Gmail给我一个错误。 “ ”Gmail无法验证mysite.com是否实际发送了此邮件(而不是垃圾邮件发送者)“。
SPF记录:(我不知道这是什么)
SPF record lookup and validation for: rrh.com
SPF records are published in DNS as TXT records.
The TXT records found for your domain are:
v=spf1 include:spf.protection.outlook.com a:mailman1-eqix-sjo.packet8.net a:mailman1-eq.packet8.net -all
google-site-verification=GDHGdTnww1rIsh46Zd-n7I-E6d6Fa1n83XZ0ppfx4e8
MS=ms49526710
google-site-verification=-O2gI7Ji-rmEFlZQq8d85jHef7bEk0UcDXt-6MW419I
Checking to see if there is a valid SPF record.
Found v=spf1 record for rrh.com:
v=spf1 include:spf.protection.outlook.com a:mailman1-eqix-sjo.packet8.net a:mailman1-eq.packet8.net -all
evaluating...
SPF record passed validation test with pySPF (Python SPF librar
其eiter头问题,或者在我结束一个错误配置。我总是谷歌之前,我张贴求助。 –
你的SPF记录是什么样的? – Chris
使用phpmailer代替https://github.com/PHPMailer/PHPMailer –