I would like to send an email using the php email() function then if it does execute i.e sends i would like to update a particular field in my db.however no matter how hard i try to the code seem to defy simply logic.here is the original code i have
include_once("mailer.php");
$thesend=mail($toto1,$subject1,$message,$headers);
if($thesend)
{
$mail_went=1;
$_SESSION['msgstatus']= "Mail sent to ".$toto1."<br>";
}else{
$mail_went=0;
$_SESSION['msgstatus']= "Mail send failure - message not sent <br>";
}
the funny part is that the code executes the else and actually gives me the Mail send failure message yet i do receive the mail in my box????
However if i do change this to be like this
include_once("mailer.php");
$thesend=mail($toto1,$subject1,$message,$headers);
if(!$thesend)
{
$mail_went=1;
$_SESSION['msgstatus']= "Mail sent to ".$toto1."<br>";
}else{
$mail_went=0;
$_SESSION['msgstatus']= "Mail send failure - message not sent <br>";
}
........all works perfect what am i missing.The $message is an HTMl doc and the MIME and content-type are ok.
Damn