This didn't work. Herre is my code:-
$email="blah@blah.com,".$values["engineermail"]."";
$subject="Spares Request";
$date_value = $values["date"];
$date_value = date("d-m-Y",strtotime($date_value));
$headers= "MIME-Version: 1.0" . "\r\n";
$headers.= "Content-type: text/html; charset=iso-8859-1" . "\r\n";
$headers.= "From: ".$values["engineer"]."\n ";
$message.='<table width="100%" border="0">
<tr>
<td height="807"><div align="center"> </div>
<p align="center"><strong>Manual Spares Request
</strong></p> <table width="90%" border="0" align="center">
<tr>
<TD
style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid" width="14%"><strong>Date</strong></td>
<TD
style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid"width="40%">'.$date_value.' </td>
</tr>
<tr>
<TD
style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid"><strong>ID</strong></td>
<TD
style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid">'.$keys["id"].'</td>
</tr>
<tr>
<TD
style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid"><strong>Instrument</strong></td>
<TD
style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid">'.$values["instrument"].' </td>
</tr>
<tr>
<TD
style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid"><strong>Customer</strong></td>
<TD
style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid">'.$values["customer"].'</td>
</tr>
<tr>
<TD
style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid"><strong>Serial Number</strong></td>
<TD
style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid">'.$values["serial_no"].'</td>
</tr>
<tr>
<TD
style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid"><strong>Project Code </strong></td>
<TD
style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid">'.$values["projectcode"].''.$values["wcsi"].'</td>
</tr>
</table>
<div align="center">
</div>
<table width="90%" border="0" align="center">
<tr>
<TD
style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid" width="22%"><strong>Ship To </strong></td>
<TD
style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid" width="78%">'.$values["shipto"].' </td>
</tr>
<tr>
<TD
style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid" height="41" colspan="2"><p><strong>Address:-</strong>
'.$values["address1"].'
'.$values["address2"].'
'.$values["address3"].'
'.$values["address4"].'
'.$values["city"].'
'.$values["state"].'
'.$values["zip"].'
'.$values["country"].'
</strong><strong>
</strong></p> </td>
</tr>
</table>
<table width="90%" border="0" align="center">
<tr>
<TD
style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid" width="10%"><strong>Notes:-</strong></td>
<td width="90%"> </td>
</tr>
<tr>
<TD
style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid" colspan="2">'.$values["notes"].' </td>
</tr>
</table>
<table width="90%" border="0" align="center">
<tr>
<TD
style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid" width="23%">'.$values["part_noa"].' </td>
<TD
style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid" width="72%">'.$values["part_namea"].' </td>
<TD
style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid" width="5%">'.$values["quantityparta"].' </td>
</tr>
</table>
<table width="90%" border="0" align="center">
<tr>
<TD
style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid" width="23%">'.$values["part_nob"].' </td>
<TD
style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid" width="72%">'.$values["part_nameb"].' </td>
<TD
style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid" width="5%">'.$values["quantitypartb"].' </td>
</tr>
</table>
<table width="90%" border="0" align="center">
<tr>
<TD
style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid" width="23%">'.$values["part_noc"].' </td>
<TD
style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid" width="72%">'.$values["part_namec"].' </td>
<TD
style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid" width="5%">'.$values["quantitypartc"].' </td>
</tr>
</table>
<table width="90%" border="0" align="center">
<tr>
<TD
style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid" width="23%">'.$values["part_nod"].' </td>
<TD
style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid" width="72%">'.$values["part_named"].' </td>
<TD
style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid" width="5%">'.$values["quantitypartd"].' </td>
</tr>
</table>
<table width="90%" border="0" align="center">
<tr>
<TD
style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid" width="23%">'.$values["part_noe"].' </td>
<TD
style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid" width="72%">'.$values["part_namee"].' </td>
<TD
style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid" width="5%">'.$values["quantityparte"].' </td>
</tr>
</table> </td>
</tr>
</table>';
mail($email, $subject, $message, $headers);
return true;
================
I know that's quite long winded since the email is sent in html code but if I set this in Before record added it works, but doesn't supply the ID (It just doesn't show up) and if I put this in after record added I get an error saying:-
Error type 8
Error description Undefined variable: message
Any ideas please?
Thanks,
Graham