title: Send multiple emails from a database using PHP
body: <p>I need help in sending multiple emails from database using <a href="http://en.wikipedia.org/wiki/PHP" rel="nofollow">PHP</a>. I have a code that work, but it can only allow one email in it. Is there some way to modify it to help me send multiple ones?</p>
  
  <pre><code>&lt;?
      require("phpmailer/class.phpmailer.php");
  
      $mail  = new PHPMailer();
      $mail-&gt;IsSMTP();
  
      //Gmail configuration
          $mail-&gt;SMTPAuth   = true;                  // enable SMTP authentication
          $mail-&gt;SMTPSecure = "ssl";                 // sets the prefix to the server
          $mail-&gt;Host       = "smtp.gmail.com";      // sets GMAIL as the SMTP server
          $mail-&gt;Port       = 465;                   // set the SMTP port for the GMAIL server
          $mail-&gt;Username   = "******@gmail.com";  // GMAIL username
          $mail-&gt;Password   = "785123nick";            // GMAIL password
          $prize = "lol";
      //End Gmail
  
      $mail-&gt;From       = "from@email.com";
      $mail-&gt;FromName   = "Jetstar";
      $mail-&gt;Subject    = "Order Redemption";
      $mail-&gt;MsgHTML("You have bought  " . $prize . " Print this and collect it at our office.");
  
      //$mail-&gt;AddReplyTo("reply@email.com","reply name"); //They answer here, optional
      $mail-&gt;AddAddress("your-email","name to");
      $mail-&gt;IsHTML(true); // send as HTML
  
      if(!$mail-&gt;Send()) { //To see if we return a message or a value bolean
          echo "Mailer Error: " . $mail-&gt;ErrorInfo;
      } 
      else  
          echo "Message sent!";
  ?&gt;
  </code></pre>