代码之家  ›  专栏  ›  技术社区  ›  Rodrigo Gama

通过Send mail发送经过身份验证的邮件

  •  0
  • Rodrigo Gama  · 技术社区  · 15 年前

    我正在使用sendmail通过php发送一堆电子邮件(不幸的是,我真的必须发送这些电子邮件)。当我停止使用我的域SMTP服务器,开始使用服务器的sendmail工具(我将域名提供商与我的主机(现在是Amazon)分离)时,电子邮件就开始进入gmail和yahoo的垃圾邮件箱。

    我收到的邮件头(来自gmail的一封电子邮件)

    Delivered-To: ***********@gmail.com
    Received: by 10.227.152.2 with SMTP id e2cs188839wbw;
            Fri, 29 Oct 2010 03:39:45 -0700 (PDT)
    Received: by 10.100.13.16 with SMTP id 16mr263366anm.209.1288348783979;
            Fri, 29 Oct 2010 03:39:43 -0700 (PDT)
    Return-Path: <apache@ip-10-194-150-64.ec2.internal>
    Received: from ip-10-194-150-64.ec2.internal (ec2-75-101-144-206.compute-1.amazonaws.com [75.101.144.206])
            by mx.google.com with ESMTP id x32si2412082vcr.72.2010.10.29.03.39.43;
            Fri, 29 Oct 2010 03:39:43 -0700 (PDT)
    Received-SPF: neutral (google.com: 75.101.144.206 is neither permitted nor denied by best guess record for domain of apache@ip-10-194-150-64.ec2.internal) client-ip=75.101.144.206;
    Authentication-Results: mx.google.com; spf=neutral (google.com: 75.101.144.206 is neither permitted nor denied by best guess record for domain of apache@ip-10-194-150-64.ec2.internal) smtp.mail=apache@ip-10-194-150-64.ec2.internal
    Received: from ip-10-194-150-64.ec2.internal (localhost [127.0.0.1] (may be forged))
        by ip-10-194-150-64.ec2.internal (8.13.8/8.13.8) with ESMTP id o9TAdhxQ017836
        for <*************e@gmail.com>; Fri, 29 Oct 2010 06:39:43 -0400
    Received: (from apache@localhost)
        by ip-10-194-150-64.ec2.internal (8.13.8/8.13.8/Submit) id o9TAdhHk017833;
        Fri, 29 Oct 2010 06:39:43 -0400
    Date: Fri, 29 Oct 2010 06:39:43 -0400
    Message-Id: <201010291039.o9TAdhHk017833@ip-10-194-150-64.ec2.internal>
    To: ***********@gmail.com
    Subject: Esqueci minha senha
    From: Cidade dos Bicos <*****************@cidadedosbicos.com.br>
    X-Mailer: Cidade dos Bicos
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 7bit
    

    谢谢

    3 回复  |  直到 15 年前
        1
  •  0
  •   Breezer    15 年前

    不,这不是真正的问题,这都是关于邮件头的,如果你发送了正确的邮件头,如果你没有真正的垃圾邮件,你就不会进入垃圾邮件箱;)

    这是一个网站,通过什么标题和他们应该如何设置 http://www.transio.com/content/how-pass-spam-filters-php-mail

        2
  •  0
  •   Philar    15 年前

    以下代码在过去对我有效。试试让我知道。

    $to = "someguy@gmail.com";
    $subject ="Howdy Pardner?";
    $message="I'm riding west, join me"; 
    $headers = 'From: me@philar.com' . "\n" .
               'Reply-To: me@philar.com' . "\n" .
           'Content-Type: text/html; charset="utf-8"' . "\n" .
               'X-Mailer: PHP/' . phpversion();
    mail($to, $subject, $message,$headers);
    
        3
  •  0
  •   Rodrigo Gama    15 年前

    供进一步参考:我的所有问题都是因为配置错误的DNS条目。当你决定发送电子邮件时,像MX、MX CNAME、PTR、DKIM这样的术语应该在你的血管里。

    http://www.codinghorror.com/blog/2010/04/so-youd-like-to-send-some-email-through-code.html