View Single Post
Old 10-04-2012, 09:36 PM   PM User | #1
mehidy
New Coder

 
Join Date: Jan 2011
Location: Bangladesh
Posts: 73
Thanks: 4
Thanked 0 Times in 0 Posts
mehidy is an unknown quantity at this point
Sending mail after updating in php

Hi Please see below,
PHP Code:
if ( $smpl_typ == "PPS" && $smpl_cmnts == "Approved" ){
require(
"connect.php");
$buyh $_POST['buyh'];
$buyr $_POST['buyr'];
$artstyl_no $_POST['artstyl_no'];
$tbl_orderid $_POST['tbl_orderid'];
$details "SELECT smpl_col, smpl_subno, smpl_senton, cmnts_rcvon, smpl_cmnts, smpl_rmks FROM tbl_smpl WHERE  smpl_tbl_order_id='$tbl_orderid' AND smpl_typ='PPS' AND smpl_cmnts='Approved'";
$details_result mysql_query$details)
        or die ( 
"Couldn't get Products: ".mysql_error() );
while ( 
$det_row mysql_fetch_array $details_result ) )
{
// message
$message " <p>Dear All<br>Please find below the sample comments for your ref of styel $artstyl_no!</p>
  <table>
        <tr>
          <th>Color</th><th>Sub no</th><th>Sub Date</th><th>Comments Date</th><th>Comments</th><th>Remarks</th>
        </tr>
<tr><td> "
.$det_row'smpl_col' ]."</td>
           <td> "
.$det_row'smpl_subno' ]."</td>
          <td> "
.$det_row'smpl_senton' ]."</td>
          <td> "
.$det_row'cmnts_rcvon' ]."</td>
          <td> "
.$det_row'smpl_cmnts' ]."</td>
          <td> "
.$det_row'smpl_rmks' ]."</td></tr>    
   
  </table><p>This is an auto generated mail, no need to reply.</p><p>Thanking you<br>noreplay@yahoo.com<br>C</p>
"
;
$to  'mehidy@yahoo.com' ', '// note the comma
//$to .= 'sultan@yahoo.com';
// subject
$subject "$smpl_typ comments of Buyer:$buyr Style:$artstyl_no";
// To send HTML mail, the Content-type header must be set
$headers  'MIME-Version: 1.0' "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' "\r\n";
// Additional headers
//$headers .= 'To: reza@yahoo.com, liton@yahoo.com' . "\r\n";
$headers .= 'From: C <mehidy@yahoo.com>' "\r\n";
//$headers .= 'Cc: zahir@yahoo.com' . "\r\n";
//$headers .= 'Bcc: mehidy1984@gmail.com' . "\r\n";
// Mail it
mail($to$subject$message$headers);
}

By using above script, after updating. i am getting two mail for two row from my mysql table. but i want to get two row details in one mail. Plz see my requirement as attached.
Attached Thumbnails
Click image for larger version

Name:	mail.gif
Views:	50
Size:	42.9 KB
ID:	11602  
mehidy is offline   Reply With Quote