`

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'];    }  }}
分享到:
评论

相关推荐

    a算法演示

    (class1.cs) is just a test for path finding, it opens a file and fills an array and uses it to pathfinding. The second class, Path(path.cs) is used by third class to find the path. The ...

    JSP Simple Examples

    After get translated the jsp file is just like a servlet. Page directive attributes A directive is a way to give special instructions to the container at page translation time. The page directive ...

    Java邮件开发Fundamentals of the JavaMail API

    The Simple Mail Transfer Protocol (SMTP) is defined by RFC 821 . It defines the mechanism for delivery of e-mail. In the context of the JavaMail API, your JavaMail-based program will communicate ...

    Wireshark- A Guide to Color My Packets

    5. **Protocols Support**: Wireshark supports a vast array of protocols, making it a versatile tool for analyzing complex networks. 6. **Live Capture and File Analysis**: Wireshark can capture packets...

    BobBuilder_app

    I deferred from testing the get test over 100 million record as it would require a huge array in memory to store the Guid keys for finding later, that is why there is a NT (not tested) in the table. ...

    CE中文版-启点CE过NP中文.exe

    Mainly minor improvements and some small bugfixes, but also a new 'ultimap like' feature called Code Filter for which you don't need any special hardware for. (Just an extensive list of addresses) ...

    VB编程资源大全(英文源码 其它)

    array.zip A simple program that shows how a two-dimensional array works within a VB program.&lt;END&gt;&lt;br&gt;70,Bubblesort.zip A simple Bubble Sort code that shows how the program works within a VB ...

    Pro Radar Builder (Source Included) 3.0.1

    - Allows for a wide array of objects objects, even particle effects to be simulated in the radar. - Static minimaps, ideal for small static scenes. - Realtime Minimap , ideal for large scenes / Open...

    UE(官方下载)

    This short tutorial provides the steps for searching for and deleting lines by writing a simple script. Parsing XML files and editing XML files Parsing XML can be a time-consuming task, especially ...

    Google C++ Style Guide(Google C++编程规范)高清PDF

    Do not forget that a -inl.h file requires a #define guard just like any other header file. Function Parameter Ordering link ▶When defining a function, parameter order is: inputs, then outputs. ...

    FastReport.v4.9.81 for.Delphi.BCB.Full.Source企业版含ClientServer中文修正版

    Once you purchase FastReport, you get more than just a report generator. Depending on FastReport edition, you get the following products that can be used in your application independent of FastReport:...

    王小平版遗传算法的光盘源代码

    You will get some tutorial feel for using the data structures involved by examining the initializations which take place in populations.c and generations.c. In general, the modules are ...

    Knockout API 中文版

    Just represent your items as a JavaScript array, and then use a foreach binding to transform this array into a TABLE or set of DIVs. Whenever the array changes, the UI changes to match (you don’t ...

    JavaScript Cookbook

    Just copy and paste the code samples into your project — you’ll get the job done faster and learn more about JavaScript in the process. You’ll also learn how to take advantage of the latest ...

    Sortable前端框架

    You can use any element for the list and its elements, not just `ul`/`li`. Here is an [example with `div`s](http://jsbin.com/qumuwe/edit?html,js,output). --- ### Options ```js var sortable = new ...

    2009 达内Unix学习笔记

    [] 匹配中括号里的内容[a-z][A-Z][0-9]。 ! 事件。 $ 取环境变量的值。 | 管道。把前一命令的输出作为后一命令的输入,把几个命令连接起来。 |经常跟tee连用,tee 把内容保存到文档并显示出来。 三、通用后...

    数位板压力测试

    Applications should be able to get the tablet informa¬tion and services they want, just the way they want them. Users should be able to use the tablet to set up an effi-cient, comfortable work ...

    php.ini-development

    Output buffering is a mechanism for controlling how much output data ; (excluding headers and cookies) PHP should keep internally before pushing that ; data to the client. If your application's ...

Global site tag (gtag.js) - Google Analytics