Here is my full mail script:
<?php
$mailTo = $row_Recordset3['email'];
$subject = 'Your Oder Status Update!!';
$cName = $row_Recordset3['c_name'];
$jobRef = $row_Recordset1['customer_ref'];
$ourRef = $row_Recordset1['our_ref'];
$framesIn = $row_Recordset1['frame_in'];
$glassin = $row_Recordset1['glass_in'];
$panelin = $row_Recordset1['panel_in'];
$roofin = $row_Recordset1['roof_in'];
$jobTotal = $row_Recordset1['amount1'];
$headers = 'From:
[email protected]' . "\r\n";
$headers .= 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=utf-8' . "\r\n";
$message = "$cName your job Ref: $jobRef status is has now changed.
Details:
Our Ref: $ourRef
Your Ref: $jobRef
Job Total: £ $jobTotal
Status
Frames In:$framesIn
Glass In:$glassin
Panel In:$panelin
Roof In:$roofin
";
if($_POST['frame_in'] == "yes" && $_POST['collected1'] == "no") {
mail($mailTo,$subject,$message,$headers);
}
?>
Please note ‘collected1’ is correct also the email fires with the following:
if ($_POST[‘frame_in’] == “yes”) {
mail($mailTo,$subject,$message,$headers);
}
I need to add the additional check Collected1 == “no” so that the email doesnt fire off when the job is finally collected changed to collected.
Thanks for helping 