while ($r = mysql_fetch_array($sql)) { $var .= ", ".$r['email']; } mail($var,$subject,$body,$headers);