note 55097 deleted from function.mail by danbrown
| From: | danbrown@php.net | Date: | Sat, 25 Apr 2009 15:04:08 +0000 |
| Subject: | note 55097 deleted from function.mail by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-153749@lists.php.net to get a copy of this message | ||
Note Submitter: a dot hari at softprosys dot com
----
Guido, the same you can do like this.
while ($emailadresses = mysql_fetch_array($query, MYSQL_ASSOC)) {
foreach ($emailadresses as $oneMailadres) {
$recepientsArr[] = "$oneMailadres"; //build up the recepients array
}
}
/* THIS IS NOT REQUIRED
// this is the tricky part: mail() will not sent to all the emailadresses, if you let your string
end with ', ', so I used substr() to remove the last two characters from the string (comma
and space).
$recepients = substr($recepients, 0, -2);
*/
//Instead...do this.
$recepients = implode(",", $recepientsArr[]);
//actual sending
mail($recepients, $subject, $mailbody, "From: $senderAddress");