note 55098 deleted from function.mail by betz
| From: | betz@php.net | Date: | Mon, 25 Jul 2005 23:10:46 +0000 |
| Subject: | note 55098 deleted from function.mail by betz | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-92434@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");