I try to send mail using php but nothing received. Actual, I want to process the send mail function after a payment gateway process. Here is my code:
$order_id = $_REQUEST['Order_Id'];
$AuthDesc = 'Y'; // $_REQUEST['AuthDesc'];
$Checksum = $_REQUEST['Checksum'];
$price = $_REQUEST['Amount'];
Gateway reply 'Y', 'N' & 'B' . Lets, I hard code it to 'Y' for test.
if($AuthDesc == 'Y'){
$payStatus='SUC';
$updateSQL="UPDATE `tbl_cc_payment` SET `checksum`='".$Checksum."', `gateway_status`='1', `customer_status`='1' WHERE `order_id`='".$order_id."'";
$updateRs=mysql_query($updateSQL);
//Send mail:
if($updateRs){
$findmailidsql=mysql_fetch_array(mysql_query("SELECT * FROM `tbl_cc_payment` WHERE `order_id`='".$order_id."'"));
$cust_mail_id=$findmailidsql['cust_email'];
$txn_date=date('Y-m-d', strtotime($findmailidsql['txn_date']));
$to = $cust_mail_id;
$subject = 'Anantonline order confirmation | Transaction ID : '.$order_id;
$headers = "From: Pecon Sale Team <sales@pecon.co.in>" . "\r\n";
$headers .= "Reply-To: Pecon Sale Team <sales@pecon.co.in>" . "\r\n";
$headers .= "CC: transaction@pecon.co.in\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
$message = '<html>';
$message = '<head><title>Order Confirmation</title></head>';
$message .= '<body>';
$message .= '<h3>Hello, World!</h3>';
$message .= '</table>';
$message .= '<tr><td colspan="3" align="left">Dear'.$findmailidsql['billing_cust_name'].',</td></tr>';
$message .= '<tr><td colspan="3" align="left">Thank you for signing up with Anant Online.</td></tr>';
$message .= '<tr><td colspan="3" align="left">This is an acknowledgement receipt of your subscription for '.ucwords($findmailidsql['suprt_plan']).' with Transaction/Order ID '.$findmailidsql['order_id'].' dated '.$findmailidsql['txn_date'].'</td></tr>';
$message .= '<tr><td><strong>The details are shown below:</strong></td></tr>';
$message .= '<tr><td>Customer Name</td><td>:</td><td>'.$findmailidsql['billing_cust_name'].'</td></tr>';
$message .= '<tr><td>Plan Subscribed</td><td>:</td><td>'.$findmailidsql['suprt_plan'].'</td></tr>';
$message .= '<tr><td>Email Address</td><td>:</td><td>'.$findmailidsql['cust_email'].'</td></tr>';
$message .= '<tr><td>Customer Id</td><td>:</td><td>'.$findmailidsql['id'].'</td></tr>';
$message .= '<tr><td>Amount debited</td><td>:</td><td>'.$findmailidsql['amount'].'</td></tr>';
$message .= '<tr><td>Date of Purchase</td><td>:</td><td>'.$txn_date.'</td></tr>';
$message .= '<tr><td>Plan Start Date</td><td>:</td><td>'.$txn_date.'</td></tr>';
$message .= '<tr><td>Plan Expiry Date</td><td>:</td><td>'.$txn_date.'</td></tr>';
$message .= '<tr><td colspan="3" align="left">Please feel free to contact our help desk for further information.</td></tr>';
$message .= '<tr><td colspan="3" align="left">We thank you for choosing Anant Online as your solution provider and look forward to serve you through our hassle free , state-of-art remote support.</td></tr>';
$message .= '<tr><td colspan="3" align="left">For any further assistance you can log on to http://www.anantonline.com or dial our Helpdesk numbers or e-mail us at support@anantonline.com</td></tr>';
$message .= '<tr><td colspan="3" align="left">Please click on the links to read our <a href="http://buy.anantonline.com/terms.php">Terms and Conditions</a> and <a href="http://buy.anantonline.com/refundpolicy.php">Refund Policy</a>.</td></tr>';
$message .= '<tr><td colspan="3" align="left">With Regards, <br><strong>Anantonline Sales Team</strong></td></tr>';
$message .= '</table>';
$message .= '</body>';
$message .= '</html>';
mail($to, $subject, $message, $headers);
}
}elseif($AuthDesc == 'N'){
$payStatus='DEC';
}elseif($AuthDesc == 'B'){
$payStatus='BAT';
}else{
$payStatus='UNK';
}
header('location:payment-result.php?txn='.$order_id.'&status='.$payStatus);
Please anyone give me a solution to fix this. Thanking you.