just a simple for a mail() amd get array()
简介:这是just a simple for a mail() amd get array()的详细页面,介绍了和php,有关的知识、技巧、经验,和一些php源码等。
class='pingjiaF' frameborder='0' src='http://biancheng.dnbcw.info/pingjia.php?id=325739' scrolling='no'> <?php// this would come from your database.$users = array('foo@foo.com','bar@bar.com','boo@boo.com');$to = 'you@youremailaddress.com';$subject = 'subject';$message = 'this is an example';$headers = 'From: you@yourwebsite.com' . "\r\n" . 'Reply-To: you@yourwebsite.com' . "\r\n" . 'Bcc: ' . implode(', ', $users) . "\r\n"; 'X-Mailer: PHP/' . phpversion();mail($to, $subject, $message, $headers);?>how would I get the emails into an array? I dont want to type them all out..?
if ($result = mysql_query("SELECT email FROM users")) { if (mysql_num_rows($result)) { $users = array(); while ($row = mysql_fetch_assoc($result)) { $users[] = $row['email']; } }}