sorry, thread title should read - mail() sends 2 copies
i have a mail operation that always sends me 2 copies of messages. can't figure out why....
$alert="";
$bademail="0";
if($submit){
if(!ereg("[A-Za-z0-9_-]+([.]{1}[A-Za-z0-9_-]+)*@[A-Za-z0-9-]+([.]{1}[A-Za-z0-9-]+)+", $email)){$bademail="1"; $alert .="something is wrong with the email address you entered";}
if (!$email){$alert .="<br>no email entered!";}
if (!$message){$alert .="<br>no message entered!";}
if($message!=="" && $bademail==0 ) {
$mailmessage = "subject:\n$subject\n\nsenders email:\n$email\n\n\nsenders message:\n$message";
$address="example@domain.com";
$sub="INQUIRY";
$headers .= "From: ".$from_name." <".$email.">\r\n";
$headers .= "Reply-To: ".$from_name." <".$email.">\r\n";
if ( mail($address, $sub, $mailmessage, $headers) ) {
$alert .= "<br><br><b>message sent. please allow up to 3 days for a response.</b>";}
}else{$alert .="<br><b>message could not be sent!</b>";}
}
?>