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

时间:2010-10-31 06:19:50

标签: email sendmail

我正在使用sendmail通过php发送大量电子邮件(我不得不发送这封电子邮件)。一旦我停止使用我的域SMTP服务器,电子邮件开始进入gmail和yahoo的垃圾邮件箱,并开始使用服务器的sendmail工具(我将我的域名提供商与我的主机分离,现在是亚马逊)。

稍微研究一下之后,我意识到只要通过身份验证(即通过我的域名的SMTP服务器)发送电子邮件,我就能解决这个问题。我可以通过sendmail中的配置来实现吗?这样,我的应用程序就不需要对我的服务器基础架构进行任何更改。

我收到的标题(来自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 个答案:

答案 0 :(得分:0)

不,这不是真正的问题,所有关于标题,如果您发送附加到邮件的正确的heeaders,如果你实际上没有垃圾邮件,你将不会进入垃圾邮件箱;)

编辑:

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

答案 1 :(得分:0)

以下代码过去对我有用。试一试,让我知道。

$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);

答案 2 :(得分:0)

进一步推荐:我所有的问题都是因为配置错误的DNS条目。当您决定发送电子邮件时,MX,mx CNAME,PTR,DKIM等词语应该在您的静脉中。

这是一个很好的参考:http://www.codinghorror.com/blog/2010/04/so-youd-like-to-send-some-email-through-code.html