我使用 php mail() 命令发送的电子邮件被 hotmail 视为垃圾邮件。我使用谷歌应用程序。我的 Mx 记录是:
Pref Hostname
0 ASPMX.L.GOOGLE.com
5 ALT1.ASPMX.L.GOOGLE.com
5 ALT2.ASPMX.L.GOOGLE.com
10 ASPMX2.GOOGLEMAIL.com
10 ASPMX3.GOOGLEMAIL.com
我的PHP代码是:
$to = "to_email@hotmail.com";
$subject = "Subject";
//headers and subject
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Return-Path: <$support@my.com>\n";
$headers .= "Content-type: text/html; charset=utf-8\r\n";
$headers .='Reply-To: '.$to.''."\n";
$headers .= "X-Sender: <www.my.com>\n";
$headers .= "X-Mailer: PHP\n";
$headers .= "X-Priority: 1\n";
$headers .= "X-MSMail-Priority: High\n";
$headers .= "X-auth-smtp-user: support@my.com\n";
$headers .= "X-abuse-contact: support@my.com\n";
$headers .= "From: MyName <support@my.com>\r\n";
$body .= "My text here here : <br />" .
"" . "<br />" . "<br />" .
"My Name";
mail($to, $subject, $body, $headers);
也许我需要添加:
- mail.my.com的MX 记录
- a像mail.my.com这样的记录。123.89.89.09
请帮忙