09-27-2007, 10:43 PM
|
#1 (permalink)
|
|
The Contributor
Join Date: Sep 2007
Posts: 41
Thanks: 0
|
Sending Mass emails
I'm writing a script to send out an email to over 2.5k of subscribed users, and am unsure on the best approach to do so, the following is what i have so far
PHP Code:
<?php $data = Sql::query("SELECT * from newsletter WHERE validated = 1"); while($newsletter = mysql_fetch_array($data)) { if($i>0){ $bcc .= ", "; } $bcc .= $newsletter['email']; $i++; } $subject = "Newsletter - " . $title; $contents = "Testing email system"; $headers = 'From: admin@domain.net.au' . "\r\n" . 'Reply-To: admin@domain.net.au' . "\r\n" . 'X-Mailer: Mailing System - PHP/' . phpversion() . "\r\n"; $headers .= 'Bcc: ' . $bcc . "\r\n"; $to = "No Reply <noreply@domain.net.au>"; mail($to, $subject, $contents, $headers); ?>
Any help on this would be great :D
|
|
|