in PHP, you usually have code that looks like
mail($to, $subject, $msg, $mailheaders);
and you can set multiple email recipients for example
$to = ' one@example.com ' . ', '; // note the comma $to .= ' two@example.com ';
Comma and. = allow multiple email recipients.
For more than two, you should use
$to = ' one@example.com ' . ', '; $to .= ' two@example.com ' . ', '; $to .= ' three@example.com ';
To do this automatically, you can tweak foreach with the last twist in the array
foreach($email as $to) { $lastone = next($email)===FALSE; $to .= $email . ', '; if(!$lastone){ $to .= $email; }
Jeff lange
source share