<?php
require("class.phpmailer.php");

$mail = new phpmailer();

$mail->From     = "home@kidspages.org";
$mail->FromName = "Kids' Pages Announcement";
$mail->Mailer   = "mail";

@MYSQL_CONNECT( "localhost", "kp_pnmonkey", "buster" );
@mysql_select_db( "kp_phoenix" );
$query  = "SELECT email_address FROM kp_emails";
$result = @MYSQL_QUERY($query);

while ( $row = mysql_fetch_array ( $result ) )
{
  // HTML body
  $body  = '';
  $body .= '<div id="idOWAReplyText69233" dir="ltr">';
  $body .= '  <div dir="ltr">';
  $body .= '    <p class="MsoNormal" style="MARGIN: 0in 0in 0pt"><font face="Arial" color="#000000" size="2"><font face="Times New Roman"><span style="mso-bidi-font-size: 13.5pt"><font size="3">Join Winnie the Pooh (and his friends, too!) as they bring the classic charm of the Hundred Acre Wood to the Denver stage in an all-new live production&mdash;<em>Disney Live!</em></font></span><em><sup>SM</sup></em> <font size="3"><em><span style="mso-bidi-font-size: 13.5pt">Winnie the Pooh</span></em><span style="mso-bidi-font-size: 13.5pt">.</span></font></font></font></p> ';
  $body .= '    <p class="MsoNormal" style="MARGIN: 0in 0in 0pt"><span style="mso-bidi-font-size: 13.5pt"><font size="3"><font face="Times New Roman">&nbsp;</font></font></span></p>';
  $body .= '    <p class="MsoNormal" style="MARGIN: 0in 0in 0pt"><font face="Times New Roman"><span style="mso-bidi-font-size: 13.5pt"><font size="3">In the first ever <i>Disney Live!</i></font></span><i><span style="FONT-SIZE: 8pt; mso-bidi-font-size: 13.5pt"><sup>SM</sup></span></i> <span style="mso-bidi-font-size: 13.5pt"><font size="3">United States tour, children and their parents will join Pooh and his friends in this exciting interactive family theatrical experience where the audience will imitate Pooh&rsquo;s renowned &ldquo;stoutness&rdquo; exercises, learn Tigger&rsquo;s exuberant Whoop-de-Dooper bounce, play along with Rabbit&rsquo;s super-sized garden vegetables as they bound through the audience and help recreate other memorable moments from the original stories.</font></span></font></p>';
  $body .= '    <p class="MsoNormal" style="MARGIN: 0in 0in 0pt"><span style="mso-bidi-font-size: 13.5pt"><font size="3"><font face="Times New Roman">&nbsp;</font></font></span></p>';
  $body .= '    <p class="MsoBodyText" style="MARGIN: 0in 0in 0pt"><font face="Times New Roman" size="3"><strong>Tickets go on sale to the public on Sunday Sept. 11th, but you can get your tickets NOW and SAVE $3.00 per ticket to the Saturday Oct. 22, 2005 4:30pm performance!</strong></font></p>';
  $body .= '    <p class="MsoBodyText" style="MARGIN: 0in 0in 0pt"><font size="3"><strong><font face="Times New Roman">&nbsp;</font></strong></font></p>';
  $body .= '    <p class="MsoBodyText" style="MARGIN: 0in 0in 0pt"><font face="Times New Roman" size="3"><strong>Just click here and use the password <span style="COLOR: blue"><a href="http://www.ticketmaster.com/promo/17670">KIDSPAGES</a></span> to purchase tickets!</strong></font></p>';
  $body .= '    <p class="MsoBodyText" style="MARGIN: 0in 0in 0pt"><font size="3"><strong><font face="Times New Roman">&nbsp;</font></strong></font></p>';
  $body .= '    <p class="MsoBodyText" style="MARGIN: 0in 0in 0pt"><font face="Times New Roman" size="3"><strong>Visit</strong></font> <a href="http://www.disneylive.com/"><font face="Times New Roman" size="3"><strong>www.disneylive.com</strong></font></a><font face="Times New Roman" size="3"> <strong>or Charge By Phone at 303-830-TIXS <span style="FONT-SIZE: 10.5pt; mso-bidi-font-size: 13.5pt">(8497)</span></font> </strong></p>';
  $body .= '    <p class="MsoBodyText" style="MARGIN: 0in 0in 0pt"><span style="FONT-SIZE: 10pt; mso-bidi-font-size: 13.5pt"><strong><font face="Times New Roman">&nbsp;</font></strong></span></p>';
  $body .= '    <p class="MsoBodyText" style="MARGIN: 0in 0in 0pt"><strong><font face="Times New Roman"><i><font size="4">Disney Live!</font></i><i><span style="FONT-SIZE: 8pt; mso-bidi-font-size: 13.5pt"><sup>SM</sup></span></i> <font size="4">Winnie the Pooh</font></font></strong></p>';
  $body .= '    <p class="MsoBodyText" style="MARGIN: 0in 0in 0pt"><strong><font face="Times New Roman" size="3">Where:<span style="mso-spacerun: yes">&nbsp;</span> Colorado Convention Center Lecture Hall Theater</font></strong></p>';
  $body .= '    <p class="MsoBodyText" style="MARGIN: 0in 0in 0pt"><strong><font face="Times New Roman" size="3">When:<span style="mso-spacerun: yes">&nbsp;</span> October 20 @<span style="mso-spacerun: yes">&nbsp;</span> 7:00pm</font></strong></p>';
  $body .= '    <p class="MsoBodyText" style="MARGIN: 0in 0in 0pt"><font size="3"><font face="Times New Roman"><strong><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span> <span style="mso-spacerun: yes">&nbsp;</span> October 21 @ 10:30am</strong> <span style="FONT-WEIGHT: normal">and</span> <strong>7:00pm</strong></font></font></p>';
  $body .= '    <p class="MsoBodyText" style="MARGIN: 0in 0in 0pt"><font size="3"><font face="Times New Roman"><strong><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span> <span style="mso-spacerun: yes">&nbsp;</span> October 22 @ 10:30am, 1:30pm,</strong> <span style="FONT-WEIGHT: normal">and</span> <strong>*4:30pm</strong></font></font></p>';
  $body .= '    <p class="MsoBodyText" style="MARGIN: 0in 0in 0pt"><font size="3"><font face="Times New Roman"><strong><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span> <span style="mso-spacerun: yes">&nbsp;</span> October 23 @ 10:30am</strong> <span style="FONT-WEIGHT: normal">and</span> <strong>1:30pm</strong></font></font></p>';
  $body .= '    <p class="MsoBodyText" style="MARGIN: 0in 0in 0pt"><span style="FONT-WEIGHT: normal"><font size="3"><font face="Times New Roman">*- $3 off 4:30pm show Saturday October 22, 2005</font></font></span></p>';
  $body .= '    <p class="MsoBodyText" style="MARGIN: 0in 0in 0pt"><strong><font size="3"><font face="Times New Roman">&nbsp;</font></font></strong></p>';
  $body .= '    <p class="MsoBodyText" style="MARGIN: 0in 0in 0pt"><span style="COLOR: red"><strong><font size="3"><font face="Times New Roman">Please feel free to pass this opportunity along to your friends and family!</font></font></strong></span></p>';
  $body .= '    <p class="MsoNormal" style="MARGIN: 0in 0in 0pt"><span style="mso-bidi-font-size: 13.5pt"><font size="3"><font face="Times New Roman">&nbsp;</font></font></span></p>';
  $body .= '    <p class="MsoNormal" style="MARGIN: 0in 0in 0pt"><font face="Times New Roman"><span style="mso-bidi-font-size: 13.5pt"><font size="3">For more information about <i>Disney Live!</i></font></span><span style="mso-bidi-font-size: 13.5pt"><font size="2"><i><sup>SM</sup></i></font></span> <span style="mso-bidi-font-size: 13.5pt"><font size="3">Winnie the Pooh, including video clips, pictures, and kids activities, visit<span style="mso-spacerun: yes">&nbsp;</span></font> <a href="http://www.disneylive.com/"><font size="3">www.Disneylive.com</font></a><font size="3">.</font></span></font></p>';
  $body .= '    <p class="MsoNormal" style="MARGIN: 0in 0in 0pt"><font size="3"><font face="Times New Roman">&nbsp;</font></font></p>';
  $body .= '    <p class="MsoNormal" style="MARGIN: 0in 0in 0pt; tab-stops: 1.75in; mso-layout-grid-align: none"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">&copy; 2005 Disney.</span></p>';
  $body .= '    <p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">We encourage you to forward this e-mail in its entirety</span></p>';
  $body .= '    <p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">to your friends and family!</span></p>';
  $body .= '    <p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">&nbsp;</span></p>';
  $body .= '    <p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none">&nbsp;</p>';
  $body .= '  </div>';
  $body .= '</div>';

  // Plain text body (for mail clients that cannot read HTML)
  $text_body  = "";
  $text_body .= "Join Winnie the Pooh (and his friends, too!) as they bring the classic charm of the Hundred Acre Wood to the Denver stage in an all-new live production—Disney Live!SM Winnie the Pooh.\n";
  $text_body .= "\n";
  $text_body .= "In the first ever Disney Live!SM United States tour, children and their parents will join Pooh and his friends in this exciting interactive family theatrical experience where the audience will imitate Pooh’s renowned “stoutness” exercises, learn Tigger’s exuberant Whoop-de-Dooper bounce, play along with Rabbit’s super-sized garden vegetables as they bound through the audience and help recreate other memorable moments from the original stories.\n";
  $text_body .= "\n";
  $text_body .= "Tickets go on sale to the public on Sunday Sept. 11th, but you can get your tickets NOW and SAVE $3.00 per ticket to the Saturday Oct. 22, 2005 4:30pm performance!\n";
  $text_body .= "\n";
  $text_body .= "Just click here and use the password KIDSPAGES at http://www.ticketmaster.com/promo/17670 to purchase tickets!\n";
  $text_body .= "\n";
  $text_body .= "Visit www.disneylive.com or Charge By Phone at 303-830-TIXS (8497)\n";
  $text_body .= "\n";
  $text_body .= "Disney Live!SM Winnie the Pooh\n";
  $text_body .= "Where: Colorado Convention Center Lecture Hall Theater\n";
  $text_body .= "When:  October 20 @  7:00pm\n";
  $text_body .= "       October 21 @ 10:30am and 7:00pm\n";
  $text_body .= "       October 22 @ 10:30am, 1:30pm, and *4:30pm\n";
  $text_body .= "       October 23 @ 10:30am and 1:30pm\n";
  $text_body .= "\n";
  $text_body .= "  *- $3 off 4:30pm show Saturday October 22, 2005\n";
  $text_body .= "\n";
  $text_body .= "Please feel free to pass this opportunity along to your friends and family!\n";
  $text_body .= "\n";
  $text_body .= "For more information about Disney Live!SM Winnie the Pooh, including video clips, pictures, and kids activities, visit www.Disneylive.com.\n";
  $text_body .= "\n";
  $text_body .= "© 2005 Disney.\n";
  $text_body .= "We encourage you to forward this e-mail in its entirety to your friends and family!\n";

  $mail->Body    = $body;
  $mail->AltBody = $text_body;
  $mail->Subject = "Join Kids' Pages at Disney Live! Winnie the Pooh";
  $mail->AddAddress( $row["email_address"] );
//  $mail->AddAddress($row["email_address"], $row["full_name"]);
//  $mail->AddStringAttachment($row["photo"], "YourPhoto.jpg");

  if(!$mail->Send())
  {
    echo "There has been a mail error sending to " . $row["email_address"] . "<br>";
  }
  else
  {
    echo "Success sending to " . $row["email_address"] . "<br>";
  }

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