note 63355 rejected from ref.mail by bjori
| From: | bjori@php.net | Date: | Tue, 21 Mar 2006 10:25:44 +0000 |
| Subject: | note 63355 rejected from ref.mail by bjori | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-106135@lists.php.net to get a copy of this message | ||
Note Submitter: designcode87 at yahoo dot com
----
Hi guys, i have been fade up with this issue, i want to send emails to multiple users at once, I am
getting email address from database and then using mail() function in a loop. See the code below,
<?php
$link = mysql_connect($host, $user, $pass);
$connect = mysql_select_db($db);
$sql = "select * from emails";
$result = mysql_query($sql);
while ($result = mysql_fetch_array($result))
{
$sendmail = mail($email, $subject, $message);
if (!$sendmail)
print "<br>Error sending email to $mail<br>";
}
?>
And the email is send to know one. If i use mail() function without loop, email is send. Please help
me.
http://www.design-code.net