hi

i have two mail function in my page.when a aggrement is signed ,mail will be sent to both the clients.
Error: when there is some problem in sending mail to one client the mail is getting delievered another client.if there is a problem i want to stop sending to both.please tell me how to do tat........

$sent = mail($to, $subject1, $body1, $headers);
$sent1 = mail_attachment("cgbasket@careerglitters.com",$too, $subject1, $body1, $attachment);
print "<table align='center' width='60%'>";
if($sent && $sent1)
{
print "<tr><td align='center'><B>Agreement has been Signed by $signby  with  $user </B></td></tr>";
}
else
{
print "<tr><td align='center'><b>Sorry,We encountered an error while sending your agreement</b></td></tr>";
}

What do you mean?like to delete the message you sent before on the clients when one encountered an error?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.