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 微信公众号自制会员卡没有收款渠道啊
  • ¥15 stable diffusion
  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘
  • ¥15 perl MISA分析p3_in脚本出错
  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误
  • ¥199 rust编程架构设计的方案 有偿