tags:

views:

94

answers:

5

I've been getting very annoyed at this as no matter what it seems spam filters are still calling my websites auto responder as spam. I've set all my headers correctly and this is what I have so far!

$headers = "From: Name<[email protected]>\r\n"
        ."Return-Path: Name<[email protected]>\r\n"
        ."Reply-To: Name<[email protected]>\r\n"
        ."Message-ID: <". time() .rand(1,1000). "@".$_SERVER['SERVER_NAME'].">\r\n"
        ."X-Mailer: PHP v".phpversion()."\r\n"
        ."MIME-Version: 1.0\r\n"
        ."Content-Type: text/plain; charset=iso-8859-1\r\n";

        @mail($_POST['email'], "Subject", "Message", $headers);

Please help me on this one! :)

This is being sent from my shared hosting providers servers.

would it help if I added the 5th parameter as below?

"-f [email protected]"

+4  A: 

Have you read this?

So You'd Like to Send Some Email (Through Code)

In a nutshell:

  1. Make sure the computer sending the email has a Reverse PTR record
  2. Configure DomainKeys Identified Mail in your DNS and code
  3. Set up a SenderID record in your DNS
Fernando
I'm using shared hosting with cpanel, How can I go about doing this?
Stefan
A: 

Is this on a home IP address? I've found that many spam filters will automatically block E-Mails coming from what looks like a home IP address.

Serplat
edited my post to clarify further
Stefan
A: 

There are a huge amount of things that contribute to deliverability issues. To scratch the surface:

  • Subject line?
  • Message Body?
  • Are your PTR records correct?
  • Do you have SPF / Sender ID / DKIM / Domain keys setup and configured?
  • Are your sending IPs blacklisted? (senderbase.org is a good way to check reputation. mxtoolbox.com is nice for checking common blacklist status.)

Most spam software will append headers to the messages marked as spam. You can check those out for additional information / the reason why they are being marked spam.

jasonbar
A: 

Reverse lookup on your mx records are crucial too. The email address that it's coming from (in your example: website.com" better be sent from the server where the mx record for website.com points to.

So if I sent an email from the address example.com, but it was sent from a server hosted at website.com, then the reverse lookup on the MX record fails because it sees that the IP address for the email address doesn't match where it was sent from.

You can also use a service like http://www.mxtoolbox.com/blacklists.aspx to check if your domain has been blacklisted.

There are also services that will analyze your email for getting labeled as spam or junk. Just search google for email spam checker.

A: 

You mentioned in a comment that you're using shared hosting: that right there is a huge strike against you when it comes to spam filters. Most recipients now perform a reverse DNS lookup to confirm the IP address and the host name of the sender match up; which will not happen on shared hosting.

More info:

Mark Trapp