Location: PHPKode > projects > The Community Wish List Server > wlserver/admin/allmail.php
    if ($mailAction == 1) {
        $to = "";
        // Retrieve all e-mail addresses
        include ("../php/dbconnect.php");
        $recipientListQuery = "select emailaddress from person where emailaddress != ''";
        $addresses = mysql_query($recipientListQuery);
        if (!$addresses) {
            die("Could not retrieve e-mail addresses: allmail.php<br>".mysql_error());
        $numAddresses = mysql_num_rows($addresses);
        print "<html>";
        print "<body>";
        print "<p>$to</p>";
        print "<p>$subject</p>";
        for ($addressCounter = 0; $addressCounter < $numAddresses; $addressCounter++) {
            $to = mysql_result($addresses,$addressCounter,"emailaddress");
            print "$to<br>";
            mail($to,$subject,$message,"From: hide@address.com\r\n"."Reply-To: hide@address.com\r\n");
        <p>Mail has been sent.</p><p><a href="../index.php">Back to wish list</a></p></body>
    } else {
                <title>Send an e-mail to everyone in the wish list!</title>
                <form name="mailform" method="post" action="allmail.php">
                <p>Subject: <input name="subject" type="text" size="50" maxlength="128" name="subject"></p>
                <textarea name="message" rows="10" cols="50" wrap="virtual"></textarea>

                <input type="hidden" value="1" name="mailAction">
                <input type="submit" value="submit">
                <input type="reset" value="clear">


Return current item: The Community Wish List Server