using PHPMailer class. I have following code. for email send to client and owner same email, only Send from information is change for client and owner. Blockquote when i submit email information ,client get double email(get 2 email) and owner get 1 email. and client get email from client information how can send individual email to both. is this code contain any error?
/* for client email send*/
$emailAddr ='owneremail@gmail.com';
$body = $client_message;
$body = eregi_replace("[\]",'',$body);
$mail->SetFrom(c, $name);
$mail->AddAddress($_POST['email'], $_POST['name']);
$mail->Subject = "subject1";
$mail->MsgHTML($body);
$mail->AddAttachment("images/download.pdf");
if(!$mail->Send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
}
/*For owner email*/
$client_message1 = $client_message;
$body = $client_message1;
$body = eregi_replace("[\]",'',$body);
$mail->SetFrom($_POST['email'], $_POST['name']);
$mail->AddAddress($emailAddr, $name);
$mail->Subject = "subject1";
$mail->MsgHTML($body);
if(!$mail->Send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
}