Re: PHP and email

From: Date: Wed, 23 Nov 2005 14:49:25 +0000
Subject: Re: PHP and email
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-226354@lists.php.net to get a copy of this message
Angelo Zanetti wrote:
Hi I have a dedicated server in the states. I need to send about 8000 emails (once off). There pretty small +- 5KB. so I want to write a php script and run it from the command line in the background. I was thinking of sending 50 emails then waiting 90 seconds then sending again. Or the same script gets run by cron every 90 seconds and just sends 50 emails. What do you recommend?
I would send them one at a time. While the script itself could probably handle sending 50+ at a time, you have to think about the mail server. Say you have the 8000 emails in an array.... #!/usr/local/bin/php <?php // Stuff to get email addresses // and create message foreach ( $emails as $email ) { mail ( $email, $subject, $message, $headers ); sleep ( 10 ); } ?> YMMV -- John C. Nichel IV Programmer/System Admin (ÜberGeek) Dot Com Holdings of Buffalo 716.856.9675 jnichel@dotcomholdingsofbuffalo.com

« previous php.general (#226354) next »