Just wondered if anyone has had any experience writting/ using a PHP script that handles large (5,000 +) mailing lists. This is what I've written so far for the sending -
PHP Code:
$mail = new phpmailer();
$mail -> IsSMTP(); 
$mail -> Host "mailserver.domain.com";
$mail -> From "from@email.com";
$mail -> Subject "free spam";

$db = new MyDatabase($dbEzine$dbServer); 
$db -> connect($user$pass);

    
$sql ="
    SELECT 
    EmailAddress, 
    SubscriberFormatPK 
    FROM 
    Email, 
    Subscribe
    WHERE 
    SubscriberNewsletterPK = "
.$this -> input['topic']."
    AND 
    SubscriberLanguagePK = "
.$this -> input['lang']."
                    "
;
    
$result $db -> query($sql);
    
$q     = new QueryIterator($result);

    
set_time_limit(0);

    
$counter 0;
    while(
$records $q -> getCurrent())
    {
        
$mail -> AddAddress($records['EmailAddress']);

        
$mail -> Body "hi ! \n\n enjoy your free spam; sent daily.";
        
$mail -> WordWrap 50;

        if(!
$mail -> Send())
        {
            echo 
'Message was not sent - '.$records['EmailAddress'].'<br>';
            echo 
'Mailer Error: ' $mail -> ErrorInfo.'<br>';
        }
        else
        {
            echo 
'Message sent - '.$records['EmailAddress'].'<br>';
        }

        
$mail -> ClearAddresses();

        
$counter ++;
        if ((
$counter 50) == 0)
        {
            
sleep(30);
        }
        
$q -> next();
    } 
I'm using the phpMailer class - http://phpmailer.sourceforge.net/ to connect directly to the SMTP server; so avoiding the slow mail() function, also sending the email's out in batches of 50 with intervals of 30 seconds to prevent tying the server up.

Any additional comments/ tips would be most greatful.