RE: [PHP] Mass Mailing Using PHP
| From: | Graham Cossey | Date: | Mon, 27 Sep 2004 08:11:32 +0000 |
| Subject: | RE: [PHP] Mass Mailing Using PHP | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-197933@lists.php.net to get a copy of this message | ||
Are your users' details in a database?
If so simply read through the database mailing to each user, something like:
<?php
$message = "Hello everyone";
$subject = "Hello";
$headers = "From: Someone <someone@somewhere.com>\r\n";
$sql = "SELECT user_name, email FROM user";
$result = mysql_query($sql) or die ("Query failed: " . mysql_error());
while ($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
$email = $row['email'];
mail($email, $subject, $message, $headers);
}
?>
HTH
Graham
-----Original Message-----
From: suneel [mailto:suneel@brainbayconsulting.com]
Sent: 27 September 2004 08:51
To: php-general@lists.php.net
Subject: [PHP] Mass Mailing Using PHP
Hi guys,
Any could tell me How to send mass mails i.e., sending the same
mail to hundreds of users..
I have tried sending the mail by keeping all mail id's in an
array and repeated the loop until the array length and the other one is I
concatenated all the mail id's to CC.
Please is there any other efficient way to achieve this...
Thanks in advance
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php