Page 1 of 1

Mail from mail() going to the spambox, any ideas!

Posted: Wed Jul 16, 2008 1:19 pm
by Citizen
I'm using a custom function to send mail here:

Code: Select all

function emailSend($aTo,$from,$subject,$message)
    {
        $fMessage = "<html>
                    <head>
                      <title>$subject</title>
                    </head>
                    <body>";
        $fMessage .= $message;
        $fMessage .= "</body>
                    </html>";
        foreach($aTo as $to){
            $headers  = 'MIME-Version: 1.0' . "\r\n";
            $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
            
            // Additional headers
            $headers .= 'To: New Account <'.$to.'>' . "\r\n";
            $headers .= 'From: '.$from['name'].' <'.$from['email'].'>' . "\r\n";        
        
            mail($to, $subject, $fMessage, $headers);
        }
    }
But I can't seem to get past yahoo's spam blocker. Is there a best practice for php mail? I've done a bunch of googling on this but can't find anything definitive.

Re: Mail from mail() going to the spambox, any ideas!

Posted: Wed Jul 16, 2008 1:33 pm
by WebbieDave
This is out of the realm of PHP coding. You'll need to research how to configure your mail server (or ask your webhost) to employ signing technologies such as DomainKeys/DKIM.

Re: Mail from mail() going to the spambox, any ideas!

Posted: Wed Jul 16, 2008 1:38 pm
by Citizen
So there's nothing wrong with my code? Nothing needs to be improved?

Re: Mail from mail() going to the spambox, any ideas!

Posted: Wed Jul 16, 2008 2:58 pm
by snowrhythm
looks like this guy had the same problem...check it out http://www.phpclasses.org/discuss/package/14/thread/2/

Re: Mail from mail() going to the spambox, any ideas!

Posted: Wed Jul 16, 2008 5:19 pm
by omniuni
I can't be sure, but I suspect it has something to do with strange "from" or "reply-to" headers.

Check that this all looks normal. Also, if you send one to me at omniuni@inbox.com I can check to see if it goes into my Spam folder to try to narrow down how/why Yahoo is detecting Spam.

Re: Mail from mail() going to the spambox, any ideas!

Posted: Wed Jul 16, 2008 6:44 pm
by Apollo
Not a real solution, but keep in mind that Yahoo's spam filtering is extremely crappy :evil:
It generates LOTS of false positives (regarding proper mail as spam), so I doubt if you can fix this 100% at your end. Please complain to Yahoo about this, the more complaints they receive, the more likely they will do something about it some day.