Sending an email to multiple recipients
<?
session_start();
session_register('LifeZip');  
session_register('LifeEmail'); 

 // connect to db
  $conn = db_connect();
  if (!$conn)
    return 'Could not connect to database server - please try later.';

// convert LifeZip and LifeEmail from previous page into $
echo 'use the variables below to find customer the just filled out forms from previous pages (initial info received from page session)';

$CustomerEmailMatch = $_SESSION['LifeEmail'];
$CustomerZipMatch = $_SESSION['LifeZip'];



//Use LifeZip/$CustomerZipMatch from above to 'match' the zip codes in 'repstable' to send in an email

$result = mysql_query("SELECT * FROM repstable WHERE RepZipCode = $CustomerZipMatch GROUP BY RepID HAVING COUNT(1) <= 3") or die(mysql_error()); 

while($row = mysql_fetch_array($result)) 
{ 
echo '<br />'; 
echo "Rep's email Address: "; 
echo '<font color="#FF7600">',$row['RepEmail'], '</font>'; 
echo '<br />'; 
echo "Rep's ID: "; 
echo '<font color="#FF7600">',$row['RepId'], '</font>'; 
echo '<hr />';

}
 
// insert 'RepEmail' which contains multiple emails into '$to:' field below and send email
$to = "webmaster @ send this to me.com";
$to = "put email(s) from 'RepEmail' here as $"
$subject = "Test mail";
$message = "Hello! This is a simple email message.";
$from = "webmaster @ send this to me.com";
$headers = "From:" . $from;
mail($to,$subject,$message,$headers);
echo "Mail Sent.";

// Thanks in Advance for this, I've been beating myself up for over a week on this one.
?>
Sending an email to multiple recipients
===

<?
session_start();
session_register('LifeZip');  
session_register('LifeEmail'); 

 // connect to db
  $conn = db_connect();
  if (!$conn)
    return 'Could not connect to database server - please try later.';

// convert LifeZip and LifeEmail from previous page into $
echo 'use the variables below to find customer the just filled out forms from previous pages (initial info received from page session)';

$CustomerEmailMatch = $_SESSION['LifeEmail'];
$CustomerZipMatch = $_SESSION['LifeZip'];



//Use LifeZip/$CustomerZipMatch from above to 'match' the zip codes in 'repstable' to send in an email

$result = mysql_query("SELECT * FROM repstable WHERE RepZipCode = $CustomerZipMatch GROUP BY RepID HAVING COUNT(1) <= 3") or die(mysql_error()); 

while($row = mysql_fetch_array($result)) 
{ 
echo '<br />'; 
echo "Rep's email Address: "; 
echo '<font color="#FF7600">',$row['RepEmail'], '</font>'; 
echo '<br />'; 
echo "Rep's ID: "; 
echo '<font color="#FF7600">',$row['RepId'], '</font>'; 
echo '<hr />';

}
 
// insert 'RepEmail' which contains multiple emails into '$to:' field below and send email
$to = "webmaster @ send this to me.com";
$to = "put email(s) from 'RepEmail' here as $"
$subject = "Test mail";
$message = "Hello! This is a simple email message.";
$from = "webmaster @ send this to me.com";
$headers = "From:" . $from;
mail($to,$subject,$message,$headers);
echo "Mail Sent.";

// Thanks in Advance for this, I've been beating myself up for over a week on this one.
?>