douli4337 2015-04-22 16:46
浏览 82
已采纳

PhpMailer发送到Gmail但不发送到hotmail帐户

I know this has been asked before, but i wanted to show my case because i tried to solve it with other answers but i coundt solve it.

I m trying to do a Contact form but when i choose the email of the receiver if i choose @hotmail.com or @advancedinstitute.cl they dont receive the email. I tried to choose another type of email like gmail, yahoo or terra and the email arrives without problem.

I know it must be because the spam policies of those servers but i dont know how to fix it.

This is my code of the phpMailer:

$mail = new PHPMailer();
$mail->Host = "localhost";
$mail->Hostname = "Advanced Institute";
$mail->From = $_POST["email"];
$mail->FromName = $_POST["email"];
$mail->Subject = "Quiero contactarme con Advanced Institute";
$mail->AddAddress("carmeng.advanced@terra.cl","Advanced Institute");
$mail->AddReplyTo($_POST["email"]);
$mail->IsHTML(true); // El correo se envía como HTML
$body = '<html><body><div>Nombre : '.$_POST["nombre"].'<br>  Email :    '.$_POST["email"].'<br>  Telefono : '.$_POST["telefono"].'<br>  Asunto : '.$_POST["asunto"].'<br>  Comentarios:           '.$_POST["comentarios"].'<br> </div></body></html>';
$mail->Body = $body;    
    if(!$mail->Body) {
        echo 'Error: ' . $mail->ErrorInfo;
    }else{
    $mail->Send();

I hope my english was enough for you guys to understand my problem. THANK YOU IN ADVANCED

  • 写回答

1条回答 默认 最新

  • doubo1711 2015-04-22 16:52
    关注

    You probably need to set up SPF records for the domain name.

    Further information: http://en.wikipedia.org/wiki/Sender_Policy_Framework

    Recommended SPF Wizard http://www.kitterman.com/spf/validate.html

    Also the from address should be from the sending domain name, not user input.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 r语言神经网络自变量重要性分析
  • ¥15 基于双目测规则物体尺寸
  • ¥15 wegame打不开英雄联盟
  • ¥15 公司的电脑,win10系统自带远程协助,访问家里个人电脑,提示出现内部错误,各种常规的设置都已经尝试,感觉公司对此功能进行了限制(我们是集团公司)
  • ¥15 救!ENVI5.6深度学习初始化模型报错怎么办?
  • ¥30 eclipse开启服务后,网页无法打开
  • ¥30 雷达辐射源信号参考模型
  • ¥15 html+css+js如何实现这样子的效果?
  • ¥15 STM32单片机自主设计
  • ¥15 如何在node.js中或者java中给wav格式的音频编码成sil格式呢