【问题标题】:Mail is not going directly into inbox邮件不会直接进入收件箱
【发布时间】:2012-11-16 17:10:34
【问题描述】:

这是我的代码。当我从一个 id 向其相同的 id 发送电子邮件时,电子邮件会变成垃圾邮件。无法确定这段代码有什么问题。例如,我发送这样的电子邮件

发件人 = abc@yahoo.com 至 = abc@yahoo.com 然后就直接去垃圾了。

    <?php

     $name=$_POST['fName'];
     $yemail = $_POST['yEmail'];
     $femail=$_POST['fEmail'];
     $message=$_POST['message']; 
     $from=$yemail;
     $to=$femail;
     $subject="Invitation for you";
     $mailBody ="<table width='628' border='0'>

    <tr><td align='left' valign='middle'><p><br><br>Hello,<br><br>This email is a       notification to let you know that your friend has invited you to <br>visit this link <a      href=www.heed-association.org>Heed Association.</a><br><br> Your friend is using this to        help people living in Pakistan by donating some money.<br><br>So your can also contribute in the areas of Health, Education, Environment and Sustainable Development<br> in the earthquake affected areas of Kashmir to improve living conditions and alleviate community distress<br><br><hr><br><br><strong>Regards<br><br>Heed Association</p></td></tr></table>";

   $headers  = 'MIME-Version: 1.0' . "\r\n";

    $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

   $headers .= 'From:  <'.$yemail.'>' . "\r\n";


   if (mail($to, $subject, $mailBody, $headers)) {

   echo "<script language='javascript'>
            window.location = 'index.php';
            </script>";


   } else {
    echo "<script language='javascript'>
            window.location = 'tell_a_form.php';
            </script>";
    }



    ?>

【问题讨论】:

  • 这似乎与雅虎的垃圾邮件过滤器有关,而不是代码中的任何内容。垃圾邮件在“发件人”字段中包含收件人地址的情况并不少见,因此这可能是雅虎的反应。
  • 使用 mail() 发送的东西被垃圾邮件发送也很常见。这不是发送邮件的好方法。使用更完整的系统,例如 phpmailer 或 swiftmailer。

标签: php email spam inbox


【解决方案1】:

我会说检查您的垃圾邮件过滤器。听起来很傻,将电子邮件添加到安全发件人列表中。您的代码中似乎没有发生任何真正时髦的事情。

【讨论】:

  • 我如何检查雅虎垃圾邮件过滤规则和法规。:)
  • 您必须从 yahoo 帐户中执行此操作。我已经有一段时间没有使用雅虎了。但通常情况下,如果您在垃圾邮件文件夹中打开电子邮件,然后单击“非垃圾邮件”按钮,则该电子邮件中的所有电子邮件都应该是安全的。
  • 好的,我会做这个过程thnkz @TyrionLannister
  • 不客气。请回来告诉我它是如何工作的。
【解决方案2】:

这可能是一个过度敏感的垃圾邮件过滤器。许多程序可以检测电子邮件是否实际上不是从“发件人”列中列出的电子邮件地址发送的。通常避免这种情况的方法是让电子邮件来自“no-reply@yourdomain.com”。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-05-19
    • 1970-01-01
    • 2011-06-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-07-12
    • 1970-01-01
    相关资源
    最近更新 更多