tags:

views:

38

answers:

2

I'm using sendmail to send a bunch of e-mails (I really have to send this e-mails, unfortunately) through php. The e-mail began to get into gmail and yahoo's SPAM boxes as soon as I stopped using my domain SMTP server, and started using the server's sendmail facility (I separated my domain name provider from my host, which is now Amazon).

After studying a little, I realized that I could solve this problem just by sending the e-mail authenticatedly (i.e. through my domain's SMTP server). Can I do that through configuration in sendmail? That way, I wouldn't need any changes on my application, only on my server infrastructure.

The headers I'm receiving (from an email at 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: <[email protected]>
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 [email protected]) 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 [email protected]) [email protected]
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 <*************[email protected]>; 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: <[email protected]>
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

Thanks

A: 

no that's not the real issue here, it's all about headers, if you send the correct heeaders attached to the mail you won't end up getting into the spam box if you don't actually spam them ;)

edit:

here is a site going through what headers and how they should be set http://www.transio.com/content/how-pass-spam-filters-php-mail

Breezer
In that link, I read: "There are a few possible solutions to the problem. Most of them involve changing server settings or PHP's mail() settings so that your domain can be reflected in the "Received" header. These are not a possibility in a shared hosting environment, so I'm not going to bother with those.". This is not my setup, so changing these options/configuration is a real possibility for me. If you could send any references about these configs, it would be great. Thanks for the help
Rodrigo Gama
well before you do that send me an email and ill check where the issue may be, my email info at divergeddesign dot st
Breezer
Just sent it, thanks
Rodrigo Gama
havent received anything :/info @ divergeddesign . st
Breezer
Well, probably got stuck... I added the headers of a e-mail I received through this very same configuration
Rodrigo Gama
A: 

The following code has worked for me in the past. Give it a try and let me know.

$to = "[email protected]";
$subject ="Howdy Pardner?";
$message="I'm riding west, join me"; 
$headers = 'From: [email protected]' . "\n" .
           'Reply-To: [email protected]' . "\n" .
       'Content-Type: text/html; charset="utf-8"' . "\n" .
           'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message,$headers);
philar