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 如何让企业微信机器人实现消息汇总整合
  • ¥50 关于#ui#的问题:做yolov8的ui界面出现的问题
  • ¥15 如何用Python爬取各高校教师公开的教育和工作经历
  • ¥15 TLE9879QXA40 电机驱动
  • ¥20 对于工程问题的非线性数学模型进行线性化
  • ¥15 Mirare PLUS 进行密钥认证?(详解)
  • ¥15 物体双站RCS和其组成阵列后的双站RCS关系验证
  • ¥20 想用ollama做一个自己的AI数据库
  • ¥15 关于qualoth编辑及缝合服装领子的问题解决方案探寻
  • ¥15 请问怎么才能复现这样的图呀