`

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 ...

    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 ...

    C++ by Example

    sample programs can programming students get more than just a 揻eel?for the language. Table of Contents Overview I Introduction to C++ 1 Welcome to C++ 2 What Is a Program? 3 Your First C++ Program 4...

    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. ...

    Expert Oracle Database Architecture 2nd Edition

    Play around with it for a few weeks and then tell us what it’s good for.” The version was something like 5.0.22, and in those days it was a lot easier getting started with Oracle. The entire ...

    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:...

    CSharp 3.0 With the .NET Framework 3.5 Unleashed(english)

    Writing a Simple C# Program 48 Creating a Visual Studio 2008 (VS2008) Project 52 Commenting Code 61 Identifiers and Keywords 64 Convention and Style 66 Variables and Types 67 Definite ...

    Beginning Python (2005).pdf

    Try It Out: Searching for Files of a Particular Type 181 Try It Out: Refining a Search 183 Working with Regular Expressions and the re Module 184 Try It Out: Fun with Regular Expressions 186 Try ...

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

    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 ...

    2009 达内Unix学习笔记

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

    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 ...

Global site tag (gtag.js) - Google Analytics