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

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Citizen
Forum Contributor
Posts: 300
Joined: Wed Jul 20, 2005 10:23 am

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

Post 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.
WebbieDave
Forum Contributor
Posts: 213
Joined: Sun Jul 15, 2007 7:07 am

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

Post 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.
Citizen
Forum Contributor
Posts: 300
Joined: Wed Jul 20, 2005 10:23 am

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

Post by Citizen »

So there's nothing wrong with my code? Nothing needs to be improved?
User avatar
snowrhythm
Forum Commoner
Posts: 75
Joined: Thu May 04, 2006 1:14 pm
Location: North Bay Area, CA

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

Post by snowrhythm »

looks like this guy had the same problem...check it out http://www.phpclasses.org/discuss/package/14/thread/2/
User avatar
omniuni
Forum Regular
Posts: 738
Joined: Tue Jul 15, 2008 10:50 pm
Location: Carolina, USA

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

Post 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.
User avatar
Apollo
Forum Regular
Posts: 794
Joined: Wed Apr 30, 2008 2:34 am

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

Post 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.
Post Reply