`

just a simple for a mail() amd get array()

阅读更多
<?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'];    }  }}
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics