hi all, i have a flash form that posts to a php sendmail script.
$from = "myemail@mydomain.com";
$subject="Selling Your Business - Get More For It";
$headers ="From:".$from."\n";
$headers .="MIME-Version: 1.0\n";
$headers .="Content-type: text/html; charset=iso-8859-1";
include("email_templates/".$template.".php");
$mail = mail($email,$subject,$mail_body,$headers);
if($mail == 1) {
$sql = "INSERT into email_marketing_stats (client_id, template, date_sent) values ('$client_id', '$template', '$tday')";
$result = mysql_query($sql,$connection);
echo "writing=Ok&";
}else{
echo "writing=Error&";
}
why is it sometimes this script send the email and prints "echo "writing=Ok&";"
and other time is prints a error
"echo "writing=Error&";"
but if you hit back and send it again it works. its has something to do with the sendmail part of this script, is it the hosting company sendmail script thing or is it something in my script..
any ideas or anyone know of a better way to do it.
cheers aron.