Getting spam blocked with mail(), help please!

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

Getting spam blocked with mail(), help please!

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