Hi

I am using belo scrip to update my data & its working fine. But i need to send auto mail after updating the data.
Here is my code
PHP Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head>
<style type="text/css"> 
 
body {
    margin:50px 0px; padding:0px;
    text-align:center;
        font:13px Tahoma,Geneva,sans-serif
    }
    
#content {
    width:1200px;
    margin:0px auto;
    text-align:left;
    padding:15px;
    border:0px dashed #333;
    background-color:#eee;
    }
</style>
<link rel="icon" href="http://www.mysite.com/favicon.ico" type="image/vnd.microsoft.icon" />
</head>
<body>
<div id='content'><h3><center>Success! </center></h3>  
<table width='100%' border='0' cellspacing='1' cellpadding='0'>
<tr>
<td>
<table width='100%' border='0' cellspacing='1' cellpadding='1'>
<tr>

<td align='center'><strong>ID</strong></td>
<td align='center'><strong>SAMPLE TYPE</strong></td>
<td align='center'><strong>SAMPLE SIZE</strong></td>
<td align='center'><strong>SAMPLE COLOR</strong></td>
<td align='center'><strong>SAMPLE QTY</strong></td>
<td align='center'><strong>SUB NO</strong></td>
<td align='center'><strong>RTS/TTS</strong></td>
<td align='center'><strong>SENT ON</strong></td>
<td align='center'><strong>C.RCV ON</strong></td>
<td align='center'><strong>COMMENTS</strong></td>
<td align='center'><strong>REMARKS</strong></td>
</tr>
<?php
error_reporting
(0);
require(
"connect.php");
// find out how many records there are to update
$size count($_POST['tbl_smpl_id']);

// start a loop in order to update each record
$i 0;
while (
$i $size) {
// define each variable
$tbl_smpl_id $_POST['tbl_smpl_id'][$i];
$smpl_typ $_POST['smpl_typ'][$i];
$smpl_size $_POST['smpl_size'][$i];
$smpl_col $_POST['smpl_col'][$i];
$smpl_qty $_POST['smpl_qty'][$i];
$smpl_subno $_POST['smpl_subno'][$i];
$smpl_rtstts $_POST['smpl_rtstts'][$i];
$smpl_senton $_POST['smpl_senton'][$i];
$cmnts_rcvon $_POST['cmnts_rcvon'][$i];
$smpl_cmnts $_POST['smpl_cmnts'][$i];
$smpl_rmks $_POST['smpl_rmks'][$i];

// do the update and print out some info just to provide some visual feedback

$query "UPDATE `tbl_smpl` SET 
`smpl_typ` = '
$smpl_typ', 
`smpl_size` = '
$smpl_size', 
`smpl_col` = '
$smpl_col',
`smpl_qty` = '
$smpl_qty',
`smpl_subno` = '
$smpl_subno',
`smpl_senton` = '
$smpl_senton',
`cmnts_rcvon` = '
$cmnts_rcvon',
`smpl_cmnts` = '
$smpl_cmnts',
`smpl_rmks` = '
$smpl_rmks',
`smpl_rtstts` = '
$smpl_rtstts'
WHERE `tbl_smpl_id` = '
$tbl_smpl_id' LIMIT 1";
mysql_query($query) or die ("Error in query: $query");
print 
"

<tr>
<td align='center'><p>
$tbl_smpl_id</p></td>
<td align='center'>
$smpl_typ</td>
<td align='center'>
$smpl_size</td>
<td align='center'>
$smpl_col</td>
<td align='center'>
$smpl_qty</td>
<td align='center'>
$smpl_subno</td>
<td align='center'>
$smpl_rtstts</td>
<td align='center'>
$smpl_senton</td>
<td align='center'>
$cmnts_rcvon</td>
<td align='center'>
$smpl_cmnts</td>
<td align='center'>
$smpl_rmks</td>
</tr>
"
;
++
$i;
}
mysql_close();
?>  
<tr>
<td colspan='13' align='center'>
<input value="HOME" type="button" onclick="window.location.href='dano.php'">
<input value="GO2 ALL VIEW" type="button" onclick="window.location.href='vod0011.php'">
<input value="del" type="button" onclick="window.location.href='ddcolupdateano.php?col_tbl_order_id=<?php echo $id?>'">
</td>
</tr>
</table>
</td>
</tr>

</table>
</div>
</body>
</html>
My requiremnet is, if $smpl_typ=pps and $smpl_cmnts=Approved then it will send auto mail to the user.
Kindly advise any suggestion or any example to achive my requirement.