I am haveing a problem where the email is sending the same message twice.
here is the email code
if (($row_getCalea['Date_Completed']) && ($row_getCalea['Completed_By']))
{
$counter=0;
$email_data = array();
while($row = mysql_fetch_array($getEmail))
{
$email_data[]= $row['EmailAddress'];
}
$comma_separated = join(",", $email_data);
$subject = 'Calea Update for '.$row_getCalea['Switch']."\n";
// build message
$message = 'To ALL,'."\n";
$message .= 'The Calea Push was Completed to '.$row_getCalea['Switch'].' CALEAS Database following the ECP Retrofit to '.$row_getCalea['Version']."\n\n";
$message .= 'Comments:'."\n";
$message .= ' '.$row_getCalea['Comments']."\n\n\n";
$message .= 'Sincerely, '."\n";
$message .= ' '.$row_getCalea['Completed_By']."\n";
$message .= 'Operation Support Services'."\n";
// additional headers
$headers = "From: email@emailaddress\r\n";
// send email
mail($comma_separated, $subject, $message,$headers);
echo ("Message Successfully Sent!");
header("location: CaleaHome.php");
else
{
echo ("Update was made");
header("location: CaleaHome.php");
}