<?php
ini_set( "max_execution_time", 3600 );
require("class.phpmailer.php");

$mail = new phpmailer();

//$mail->From       = "eBlast@kidspages.org";
//$mail->AddReplyTo = "eBlast@kidspages.org";
//$mail->FromName   = "Kids' Pages Family";

$mail->Mailer     = "mail";

@MYSQL_CONNECT( "localhost", "kp_pnmonkey", "buster" );
@mysql_select_db( "kp_phoenix" );

$query = "select distinct email_address from kp_emails where ( email_address not in (select email_address from kp_emails_block) ) and ( email_address not in (select email from kp_ebook_unsubscribe) ) and ( email_address not in (select email from kp_ebook_sent ) )";

// $query = "select distinct email_address from kp_emails where email_address not in (select email_address from kp_emails_block)";
// $query = "select distinct email_address from kp_emails where ( email_address not in (select email_address from kp_emails_block) ) and ( email_address not in (select email from kp_ebook_unsubscribe) )"

echo '### Start: ' . date('l jS \of F Y h:i:s A') . "<br />";

$result = @MYSQL_QUERY($query);

$numrows = mysql_num_rows( $result );
echo "$numrows addresses to process... <br />";
$count = 0;

while ( $row = mysql_fetch_array ( $result ) )
{
  $email_address = $row["email_address"];
  $count++;

// HTML body
$body =
<<<EOT

<html>
<head>
<title>KidsPages.org - FREE Family Fun!</title>
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="center" bgcolor="#FFFFFF">
<table border="0" cellpadding="0" cellspacing="0" width="575">
<tr>
<td align="left" bgcolor="#FFFFFF" height="50" valign="top"><a href="http://kidspages.org" target="_blank"><img alt="kidspages.org" src="http://kidspages.org/newsletter/images/2009-04-01/KidsPagesLogo-0904.gif" width="384" height="80" border="0" /></a></td>
<td align="right" bgcolor="#FFFFFF" height="50" style="line-height:0px; font-size:0px;" valign="top">&nbsp;</td>
</tr>
<tr>
<td colspan="2">
<hr color="#B7CD60" noshade="noshade" size="1px">
</td>
</tr>
<tr>
<td colspan="2">
<div style="font-family:Arial, Helvetica, sans-serif;font-size:25px;font-weight:bold;padding-bottom:6px;color:#594022;">
<div style="font-size:15px;color:black;line-height:150%;">
</div>
</div>
</td>
</tr>
<tr>
<td height="100%" valign="top">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<!-- 1 Apex -->
<tr>
<td align="left" bgcolor="#FFFFFF" height="100%">
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="381">
<tr>
<td colspan="2" height="12" rowspan="2" style="line-height:0px; font-size:0px;" width="12"><img height="12" src="http://kidspages.org/newsletter/images/2008-04-01/color001_ul_corner.jpg" width="12" alt="" /></td>
<td bgcolor="#9A9B96" height="1px" style="line-height:0px; font-size:0px;" width="357"></td>
<td colspan="2" height="12" rowspan="2" style="line-height:0px; font-size:0px;" width="12"><img height="12" src="http://kidspages.org/newsletter/images/2008-04-01/color001_ur_corner.jpg" width="12" alt="" /></td>
</tr>
<tr><td bgcolor="#E2E5D2" height="11" style="line-height:0px; font-size:0px;"></td></tr>
<tr>
<td bgcolor="#9A9B96" height="100%" style="line-height:0px; font-size:0px;" width="1"></td><td bgcolor="#E2E5D2" height="100%" style="line-height:0px; font-size:0px;" width="11"></td>
<td align="left" bgcolor="#E2E5D2" height="100%" style="font-size: 12px; color:#343436; line-height:16px;" valign="top">
<div style="font-family:Arial, Helvetica, sans-serif;font-size:25px;line-height:27px;font-weight:bold;padding-bottom:10px;color:#005bab;">
Celebrate Father's Day with family fun at the Apex Center!
</div>
<font style="font-family:Arial, Helvetica, sans-serif;font-size:14px;line-height:21px;">
<div style="float:left;padding: 5px 5px 5px 0px;">
<a href="http://apexprd.org/2011-father-day-5k" target="_blank"><img src="http://kidspages.org/newsletter/images/2011-05-01/Apex-5K.jpg" width="240" height="288" border="0" alt="" /></a>
</div>
<p>It's a tradition that keeps getting better each year.the fourth annual Father's Day 5K Run and family fun run/walk! It's set for Sunday, June 19 at the Apex Center.</p>
<p>You'll enjoy all of the great features from previous years: a scenic neighborhood route, tech shirts and pancake breakfast included with the entry fee, and of course the ugly tie contest. New this year: a 9am start for the fun run and $650 in cash prizes!</p>
<p>Event proceeds go to youth community recreation programs through the Apex Park and Recreation District Foundation, a non-profit agency dedicated to improving local community recreation.</p>
<strong>
Sunday, June 19<br />
The Apex Center<br />
13150 W. 72nd Avenue<br />
<br />
Questions?<br />
Visit <a href="http://apexprd.org/2011-father-day-5k" target="_blank">apexprd.org/2011-father-day-5k</a><br />
Or call 303-424-2739<br />
</strong>
<div>
<a href="http://apexprd.org/2011-father-day-5k" target="_blank"><img src="http://kidspages.org/newsletter/images/2011-04-01/Apex-logo.gif" width="340" height="180" border="0" alt="" /></a>
</div>
</font>
</td>
<td bgcolor="#E2E5D2" height="100%" width="11"></td><td bgcolor="#9A9B96" height="100%" width="1"></td>
</tr>
<tr><td colspan="5" style="line-height:0px; font-size:0px;"><img height="12" src="http://kidspages.org/newsletter/images/2008-04-01/color001_bottom.jpg" width="381" alt="" /></td></tr>
<tr><td colspan="5" style="line-height:0px; font-size:0px;"><img height="14" src="http://kidspages.org/newsletter/images/2008-04-01/pix.gif" width="1" alt="" /></td></tr>
</table>
</td>
</tr>
<!-- /1 Apex -->
<!-- 2 Bear Creek Stables -->
<tr>
<td align="left" bgcolor="#FFFFFF" height="100%">
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="381">
<tr>
<td colspan="2" height="12" rowspan="2" style="line-height:0px; font-size:0px;" width="12"><img height="12" src="http://kidspages.org/newsletter/images/2008-04-01/color001_ul_corner.jpg" width="12" alt="" /></td>
<td bgcolor="#9A9B96" height="1px" style="line-height:0px; font-size:0px;" width="357"></td>
<td colspan="2" height="12" rowspan="2" style="line-height:0px; font-size:0px;" width="12"><img height="12" src="http://kidspages.org/newsletter/images/2008-04-01/color001_ur_corner.jpg" width="12" alt="" /></td>
</tr>
<tr><td bgcolor="#E2E5D2" height="11" style="line-height:0px; font-size:0px;"></td></tr>
<tr>
<td bgcolor="#9A9B96" height="100%" style="line-height:0px; font-size:0px;" width="1"></td><td bgcolor="#E2E5D2" height="100%" style="line-height:0px; font-size:0px;" width="11"></td>
<td align="left" bgcolor="#E2E5D2" height="100%" style="font-size: 12px; color:#343436; line-height:16px;" valign="top">
<div style="font-family:Arial, Helvetica, sans-serif;font-size:25px;line-height:27px;font-weight:bold;padding-bottom:10px;color:#005bab;">
Horse Day Camps<br />All Summer Long!
</div>
<font style="font-family:Arial, Helvetica, sans-serif;font-size:14px;line-height:21px;">
<a href="http://bearcreekstablescolorado.com/horsedaycamps.htm" target="_blank"><img src="http://kidspages.org/newsletter/images/2011-04-01/BearCreekStables.jpg" width="340" height="255" border="0" alt="" /></a><br />
<p>Bear Creek Stables Horse Day Camps offers a great summer program for kids ages 8 & up. Week Long Fun, Day Camps include: Grooming, Anatomy, Gymkhana, Horse Care, Trail Rides, Tack, Horsemanship Classes and Certificate of Achievement upon completion. Each rider is assigned their own camp horse for the week!</p>
<p>Horse Day Camps start the First week of June 6 and end the last full week of August 8!</p>
<p>The stable address is 15600 West Morrison Road, Morrison, Colorado. Take the Morrison road exit from C470, go east 1/4 mile. Use the Bear Creek Lake Park entrance. Follow signs to stable or the appropriate facility.</p>
<strong>
Cost: $395.00<br />
Monday-Friday, 9am-4pm<br />
Registration is limited. Call 303-697-9666<br />
<a href="http://bearcreekstablescolorado.com/horsedaycamps.htm" target="_blank">bearcreekstablescolorado.com</a><br />
</strong>
</font>
</td>
<td bgcolor="#E2E5D2" height="100%" width="11"></td><td bgcolor="#9A9B96" height="100%" width="1"></td>
</tr>
<tr><td colspan="5" style="line-height:0px; font-size:0px;"><img height="12" src="http://kidspages.org/newsletter/images/2008-04-01/color001_bottom.jpg" width="381" alt="" /></td></tr>
<tr><td colspan="5" style="line-height:0px; font-size:0px;"><img height="14" src="http://kidspages.org/newsletter/images/2008-04-01/pix.gif" width="1" alt="" /></td></tr>
</table>
</td>
</tr>
<!-- /2 Bear Creek Stables -->
<!-- 3 Butterfly Pavilion -->
<tr>
<td align="left" bgcolor="#FFFFFF" height="100%">
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="381">
<tr>
<td colspan="2" height="12" rowspan="2" style="line-height:0px; font-size:0px;" width="12"><img height="12" src="http://kidspages.org/newsletter/images/2008-04-01/color001_ul_corner.jpg" width="12" alt="" /></td>
<td bgcolor="#9A9B96" height="1px" style="line-height:0px; font-size:0px;" width="357"></td>
<td colspan="2" height="12" rowspan="2" style="line-height:0px; font-size:0px;" width="12"><img height="12" src="http://kidspages.org/newsletter/images/2008-04-01/color001_ur_corner.jpg" width="12" alt="" /></td>
</tr>
<tr><td bgcolor="#E2E5D2" height="11" style="line-height:0px; font-size:0px;"></td></tr>
<tr>
<td bgcolor="#9A9B96" height="100%" style="line-height:0px; font-size:0px;" width="1"></td><td bgcolor="#E2E5D2" height="100%" style="line-height:0px; font-size:0px;" width="11"></td>
<td align="left" bgcolor="#E2E5D2" height="100%" style="font-size: 12px; color:#343436; line-height:16px;" valign="top">
<div style="font-family:Arial, Helvetica, sans-serif;font-size:25px;line-height:27px;font-weight:bold;padding-bottom:2px;color:#005bab;">
Bloomapalooza at the<br />Butterfly Pavilion!
</div>
<font style="font-family:Arial, Helvetica, sans-serif;font-size:14px;line-height:21px;">
<div style="padding: 5px 0px 5px 5px;">
<a href="http://butterflies.org/events/Bloomapalooza.php" target="_blank"><img src="http://kidspages.org/newsletter/images/2011-05-01/Butterfly-Bloom.jpg" width="300" height="256" border="0" alt="" /></a>
</div>
<p>Dig, plant, touch, smell and grow at Bloomapalooza, Saturday May 21 at the Butterfly Pavilion. It's a day filled with programs for conservationists, gardeners, and nature-lovers alike! The indoor/outdoor event includes hands-on gardening opportunities, interactive demonstrations, live music, and entertaining family activities. Start the day with a 1-mile community walk with CBS Channel 4 anchor Jennifer Zeppelin or volunteer with the habitat restoration project on the nature trail. The outdoor informational fair includes the Garden Centers of Colorado, Broomfield Wildlife Masters, South Platte Park Outreach, Jeffco Master Gardeners, Tagawa Gardens and the Rocky Mountain Bird Observatory. Families can design birdhouses with the National Wildlife Federation, release ladybugs, create trail mix at the Whole Foods booth or get dirty in the gardens. Get outdoors and create habitat! All event activities are included with admission. Doors open at 9am with the last entrance at 4:15pm.</p>
<strong>
Saturday, May 21<br />
10am to 5pm<br />
Event included with the price of admission; members are free.<br />
<br />
Butterfly Pavilion<br />
6252 West 104th Avenue, Westminster<br />
303-469-5441<br />
For more information, dig in at <a href="http://butterflies.org/events/Bloomapalooza.php" target="_blank">butterflies.org</a>
</strong>
<div>
<a href="http://butterflies.org" target="_blank"><img src="http://kidspages.org/newsletter/images/2010-06-01/ButterflyPavilion-logo.gif" width="213" height="104" border="0" alt="" /></a>
</div>
</font>
</td>
<td bgcolor="#E2E5D2" height="100%" width="11"></td><td bgcolor="#9A9B96" height="100%" width="1"></td>
</tr>
<tr><td colspan="5" style="line-height:0px; font-size:0px;"><img height="12" src="http://kidspages.org/newsletter/images/2008-04-01/color001_bottom.jpg" width="381" alt="" /></td></tr>
<tr><td colspan="5" style="line-height:0px; font-size:0px;"><img height="14" src="http://kidspages.org/newsletter/images/2008-04-01/pix.gif" width="1" alt="" /></td></tr>
</table>
</td>
</tr>
<!-- /3 Butterfly Pavilion -->
<!-- 4 Heritage Square -->
<tr>
<td align="left" bgcolor="#FFFFFF" height="100%">
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="381">
<tr>
<td colspan="2" height="12" rowspan="2" style="line-height:0px; font-size:0px;" width="12"><img height="12" src="http://kidspages.org/newsletter/images/2008-04-01/color001_ul_corner.jpg" width="12" alt="" /></td>
<td bgcolor="#9A9B96" height="1px" style="line-height:0px; font-size:0px;" width="357"></td>
<td colspan="2" height="12" rowspan="2" style="line-height:0px; font-size:0px;" width="12"><img height="12" src="http://kidspages.org/newsletter/images/2008-04-01/color001_ur_corner.jpg" width="12" alt="" /></td>
</tr>
<tr><td bgcolor="#E2E5D2" height="11" style="line-height:0px; font-size:0px;"></td></tr>
<tr>
<td bgcolor="#9A9B96" height="100%" style="line-height:0px; font-size:0px;" width="1"></td><td bgcolor="#E2E5D2" height="100%" style="line-height:0px; font-size:0px;" width="11"></td>
<td align="left" bgcolor="#E2E5D2" height="100%" style="font-size: 12px; color:#343436; line-height:16px;" valign="top">
<div style="font-family:Arial, Helvetica, sans-serif;font-size:25px;line-height:27px;font-weight:bold;padding-bottom:10px;color:#005bab;">
Golden Gold Rush 5K Quarry Run/Walk at Heritage Square!
</div>
<font style="font-family:Arial, Helvetica, sans-serif;font-size:14px;line-height:21px;">
<div style="float:left;padding: 5px 5px 5px 0px;">
<a href="http://heritagesquare.info" target="_blank"><img src="http://kidspages.org/newsletter/images/2011-05-01/heritage-5k.gif" width="240" height="278" border="0" alt="" /></a>
</div>
<p>Golden Gold Rush 5K Quarry Run/Walk at Heritage Square Family Entertainment Village on Saturday June 4th to benefit the Golden Fire Department.</p>
<p>A challenging cross-country style run or walk between Heritage Square and the Specification Aggregates Quarry. One of only three races in the United States that takes place at a quarry site!</p>
After the Race:
<ul style="margin-top:0px;">
<li>Live Entertainment by Cain and Tuesday Night Blues Band</li>
<li>Kids 1/3-mile Fun Run through Heritage Square<br />(9 and under)</li>
<li>Lafarge Truck Rodeo</li>
</ul>
<p>Heritage Square Family Entertainment Village features unique shops, amusement rides, a giant maze, children's theater, and one of Colorado's best alpine slides. No admission fees and free parking. Open Daily.</p>
<strong>
Saturday, June 4, 2011 at 7am,<br />check in starts at 5:30am<br />
<br />
Heritage Square Upper Parking Lot<br />
18301 W Colfax Ave, Golden<br />
<p>Heritage Square Family Entertainment Village -- where fun is a family tradition.</p>
<p>For additional information please visit us online at <a href="http://heritagesquare.info" target="_blank">heritagesquare.info</a> or call our main office phone number 303-PARTIES (303-727-8437)</p>
</strong>
<div>
<a href="http://heritagesquare.info" target="_blank"><img src="http://kidspages.org/newsletter/images/2010-11-01/HeritageSquare-logo.gif" width="270" height="230" border="0" alt="" /></a>
</div>
</font>
</td>
<td bgcolor="#E2E5D2" height="100%" width="11"></td><td bgcolor="#9A9B96" height="100%" width="1"></td>
</tr>
<tr><td colspan="5" style="line-height:0px; font-size:0px;"><img height="12" src="http://kidspages.org/newsletter/images/2008-04-01/color001_bottom.jpg" width="381" alt="" /></td></tr>
<tr><td colspan="5" style="line-height:0px; font-size:0px;"><img height="14" src="http://kidspages.org/newsletter/images/2008-04-01/pix.gif" width="1" alt="" /></td></tr>
</table>
</td>
</tr>
<!-- /4 Heritage Square -->
<!-- 5 Harkins -->
<tr>
<td align="left" bgcolor="#FFFFFF" height="100%">
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="381">
<tr>
<td colspan="2" height="12" rowspan="2" style="line-height:0px; font-size:0px;" width="12"><img height="12" src="http://kidspages.org/newsletter/images/2008-04-01/color001_ul_corner.jpg" width="12" alt="" /></td>
<td bgcolor="#9A9B96" height="1px" style="line-height:0px; font-size:0px;" width="357"></td>
<td colspan="2" height="12" rowspan="2" style="line-height:0px; font-size:0px;" width="12"><img height="12" src="http://kidspages.org/newsletter/images/2008-04-01/color001_ur_corner.jpg" width="12" alt="" /></td>
</tr>
<tr><td bgcolor="#E2E5D2" height="11" style="line-height:0px; font-size:0px;"></td></tr>
<tr>
<td bgcolor="#9A9B96" height="100%" style="line-height:0px; font-size:0px;" width="1"></td><td bgcolor="#E2E5D2" height="100%" style="line-height:0px; font-size:0px;" width="11"></td>
<td align="left" bgcolor="#E2E5D2" height="100%" style="font-size: 12px; color:#343436; line-height:16px;" valign="top">
<div style="font-family:Arial, Helvetica, sans-serif;font-size:25px;line-height:27px;font-weight:bold;padding-bottom:10px;color:#005bab;">
Summer Movie Fun at<br />Harkins Theaters!
</div>
<font style="font-family:Arial, Helvetica, sans-serif;font-size:14px;line-height:21px;">
<div style="float:left;padding: 5px 5px 5px 0px;">
<a href="http://www.harkinstheatres.com/smf" target="_blank"><img src="http://kidspages.org/newsletter/images/2011-05-01/HarkinsTop.jpg" width="176" height="195" border="0" alt="" /></a>
</div>
<p>The temperatures are climbing. The school days are counting down. It's summertime! And that means two things; blockbuster movies and the Harkins Summer Movie Fun program for kids (all adults must be accompanied by children). For over 30 years, Harkins Theatres has brought back some of Hollywood's best family films to keep kids entertained and cool during the summer. Kids can enjoy a movie a week for 10 weeks, for 50 cents per film if you purchase the ten-week season ticket pack for $5. This year, blockbusters like "Shrek Forever After," "Megamind," and "Yogi Bear" join the exciting line-up. Make Harkins Summer Movie Fun for kids an annual tradition for your family.</p>
<strong>
Harkins Northfield 18 Theatres, I-70 and I-270<br />
8300 East Northfield Boulevard, Denver<br />
<br />
For all titles and details, visit <a href="http://www.harkinstheatres.com/smf" target="_blank">www.harkinstheatres.com/smf</a><br />
</strong>
<div>
<a href="http://www.harkinstheatres.com/smf" target="_blank"><img src="http://kidspages.org/newsletter/images/2009-04-01/HarkinsLogo.gif" width="250" height="134" border="0" alt="" /></a>
</div>
</font>
</td>
<td bgcolor="#E2E5D2" height="100%" width="11"></td><td bgcolor="#9A9B96" height="100%" width="1"></td>
</tr>
<tr><td colspan="5" style="line-height:0px; font-size:0px;"><img height="12" src="http://kidspages.org/newsletter/images/2008-04-01/color001_bottom.jpg" width="381" alt="" /></td></tr>
<tr><td colspan="5" style="line-height:0px; font-size:0px;"><img height="14" src="http://kidspages.org/newsletter/images/2008-04-01/pix.gif" width="1" alt="" /></td></tr>
</table>
</td>
</tr>
<!-- /5 Harkins -->
</table>
</td>
<td align="right" height="100%" valign="top">
<table border="0" cellpadding="0" cellspacing="0" width="177">
<tr>
<td colspan="5" style="line-height:0px; font-size:0px;"><img alt="Kids' Pages eBlast" src="http://kidspages.org/newsletter/images/2011-05-01/kphead.gif" width="177" height="59"></td>
</tr>
<tr>
<td bgcolor="#999999" height="100%" width="1"></td>
<td bgcolor="#E3EDB9" height="100%" width="11"></td>
<td align="center" bgcolor="#E3EDB9" height="100%" style="font-family:Arial, Helvetica, sans-serif;font-size:12px; color:#343436;padding-bottom:3px; line-height:16px;" valign="top" width="153">
<br />
<!-- Sidebar: 01 -->
<div style="padding-right:0px;padding-top:0px;padding-bottom:10px;">
<a href="http://kidspages.org" target="_blank"><img src="http://kidspages.org/newsletter/images/2010-02-01/CalendarFamily.gif" width="150" height="209" border="0" alt="" /></a>
</div>
<div align="center" style="font-size:17px; line-height: 19px; font-weight:bold; color:#4e5670;">
<em>The</em> #1 Events Calendar for Front Range Families!
</div>
<div style="text-align:center;line-height:150%;">
<p style="margin-top:5px;">
<a href="http://kidspages.org" target="_blank">KidsPages.org</a> brings you the Most Comprehensive Family Calendar with hundreds of free and low-cost events. Enjoy!
</p>
<p style="margin-top:0px;"><a href="http://kidspages.org" target="_blank">Click here to visit your Family Calendar!</a></p>
</div>
<br />
<!-- /Sidebar: 01 -->
<!-- Sidebar: 02 -->
<div style="padding-right:0px;padding-top:0px;padding-bottom:10px;">
<a href="http://kidspages.org/contests" target="_blank"><img src="http://kidspages.org/newsletter/images/2010-03-01/MonthlyContests.gif" width="150" height="209" border="0" alt="" /></a>
</div>
<div align="center" style="font-size:17px; line-height: 19px; font-weight:bold; color:#4e5670;">
Kids' Pages Monthly Contests
</div>
<div style="text-align:center;line-height:150%;">
<p style="margin-top:5px;">
<b>Every month</b> <a href="http://kidspages.org/contests" target="_blank">Kids' Pages</a> has the best and most exciting contests around. Don't miss out, enter today!
</p>
<p style="margin-top:0px;"><a href="http://kidspages.org/contests" target="_blank">Click here and<br />enter to win today!</a></p>
</div>
<br />
<!-- /Sidebar: 02 -->
</td>
<td bgcolor="#E3EDB9" height="100%" style="line-height:0px; font-size:0px;" width="11"></td>
<td bgcolor="#999999" height="100%" style="line-height:0px; font-size:0px;" width="1"></td>
</tr>
<tr>
<td colspan="5" style="padding: 0 0 14px 0; line-height:0px; font-size:0px;"><img border="0" height="12" src="http://kidspages.org/newsletter/images/2008-04-01/kpbook_bottom.jpg" width="177" alt="" /></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table align="center" border="0" cellpadding="0" cellspacing="0" width="575">
<tr>
<td align="left" valign="top" width="100%">
<p style="font-size:9px;">
<font color="#000000" face="Verdana, Arial, Helvetica, sans-serif" size="1" style="font-size: 9px; font-family: Verdana, Arial, Helvetica, sans-serif;">
Don't see the images in this e-mail? Please add eblast@KidsPages.org to<br /> your address book or safe senders list.<br />
<br />
You are receiving these eBlasts because of your relationship with KidsPages.org.<br />
We will never share our mailing list with anyone. If you do not wish to continue<br />
receiving these announcements, please click <a href="http://kidspages.org/unsubscribe/$email_address">here</a> to unsubscribe.<br />
<br />
&copy; Copyright 2011 Kids Pages Family Media, Inc.
</font>
</p>
</td>
</tr>
</table>
</body>
</html>

EOT;

// Plain text body (for mail clients that cannot read HTML)
$text_body  =
<<<EOT

FREE Family Fun Galore!

Go to KidsPages.org to visit the Most Comprehensive Family Calendar with hundreds of free and low-cost events. Enjoy!

EOT;

//  $mail->From       = "eBlast@kidspages.org";
//  $mail->AddReplyTo = "eBlast@kidspages.org";
//  $mail->FromName   = "Kids' Pages Family";
//  $mail->Mailer     = "mail";
//  $mail->AddReplyTo = "eBlast@kidspages.org";
//  $mail->FromName   = "Kids' Pages Family";

  $mail->SetFrom("eBlast@kidspages.org", "Kids' Pages Family");
  $mail->AddReplyTo("eBlast@kidspages.org", "Kids' Pages Family");
  $mail->Mailer     = "mail";

  $mail->Body    = $body;
  $mail->AltBody = $text_body;

//  $mail->Subject = "The #1 Events Calendar for Front Range Families!";
//  $mail->Subject = "Watch Kids' Pages Every Friday Morning on TV!";
//  $mail->Subject = "February Fun from Kids' Pages";
  $mail->Subject = "May Fun from Kids' Pages";
  $mail->AddAddress( $email_address );

//    echo "NOT sending $count / $numrows to " . $email_address . "<br>";
//    $insertsql = "INSERT INTO `kp_ebook_sent` (`email`) VALUES ( '$email_address' )";
//    $insert_success = MYSQL_QUERY( $insertsql );
//    echo "insert was" . ( $insert_success ? " very" : " NOT" ) . " successful<br /><br />";

  if ( !$mail->Send() )
  {
    echo "$count / $numrows : There has been a mail error sending to " . $email_address . "<br>";
  }
  else
  {
    echo "$count / $numrows : Success sending to " . $email_address . "<br>";

    $insertsql = "INSERT INTO `kp_ebook_sent` (`email`) VALUES ( '$email_address' )";
    @MYSQL_QUERY( $insertsql );
  }

  // Clear all addresses and attachments for next loop
  $mail->ClearAddresses();
  $mail->ClearAttachments();
}

  echo "<br />";
  echo "### COMPLETE ###<br />";
  echo '### End: ' . date('l jS \of F Y h:i:s A') . "<br />";
?>
