i am not good at php so need some help.I have a php page with check box from where i am trying to send mail to multiple recipient. i can send mail but with little problem. when i select eg. 3 check box to send email then 1st email recipient is ok but 2nd email goes with 1st and 2nd recipient and 3rd email goes 1st,2nd,3rd recipient. i guess having problem with 'foreach'. will someone pls help me to send individual email to individual recipient with my MySQL query's.

Here is my code for mail.php page


    <title>PHPMailer - SMTP basic test with authentication</title>
    //include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded
    $mail = new PHPMailer();
    //$body = file_get_contents('contents.php');
    //$body = eregi_replace("[\]",'',$body);

$sender_name		=	$_SESSION['sender_name'];
$sender_email		=	$_SESSION['sender_email'];
$sender_password	=	$_SESSION['sender_password'];

$id_user	=	$_POST["id_user"];

foreach ($id_tariff as $idt)
	$query = sprintf("SELECT From_Date, To_Date, first, last, city, country, Email_1, Email_2, account_name FROM user_info where id_user = $id_user");
	$result = mysql_query($query) or die(mysql_error());

$body = "
<table width='100%' border='1' cellspacing='0' cellpadding='3' bordercolor='#ffcccc'>
<th bgcolor='#cc3333'>From</th>
<th bgcolor='#cc3333'>To</th>
<th bgcolor='#cc3333'>First Name</th>
<th bgcolor='#cc3333'>Last Name</th>
<th bgcolor='#cc3333'>City</th>
<th bgcolor='#cc3333'>country</th>

 while($row = mysql_fetch_array($result)){
  $body .="<tr>";
  $body .="<td>".$row['From_Date']."</td>";
  $body .="<td bgcolor='#FFE8E8'>".$row['To_Date']."</td>";
  $body .="<td>".$row['first']."</td>";
  $body .="<td bgcolor='#FFE8E8'>".$row['last']."</td>";
  $body .="<td>".$row['city']."</td>";
  $body .="<td bgcolor='#FFE8E8'>".$row['country']."</td>";
  $body .="</tr>";
  $to1 = $row['Email_1'];
  $to2 = $row['Email_2'];
  $account_name = $row['account_name'];
  $body .="</table>";

    $mail->IsSMTP(); // telling the class to use SMTP
    $mail->Host = "smtp.gmail.com"; // SMTP server
    $mail->SMTPDebug = 1; // enables SMTP debug information (for testing)
    // 1 = errors and messages
    // 2 = messages only
    $mail->SMTPAuth = true; // enable SMTP authentication
	$mail->SMTPSecure = "ssl";
    $mail->Host = "smtp.gmail.com"; // sets the SMTP server
    $mail->Port = 465; // set the SMTP port for the GMAIL server
    $mail->Username = "$sender_email"; // SMTP account username
    $mail->Password = "$sender_password"; // SMTP account password


    $mail->Subject = "Hello Dear $account_name";

    $mail->AltBody = "To view the message, please use an HTML compatible email viewer!";



    if(!$mail->Send()) {
    echo "Mailer Error: " . $mail->ErrorInfo;
    } else {
    echo "YOUR E-MAIL HAS SENT";


Thanks in Advance