Hi everyone!
I've worked on a shopping cart and I have a small problem.
When an order is made, it doesn't send a notification email. It all seems ok but I don't know why it doesn't work. Here is the code:
<?php
header ('Content-type: text/html; charset=utf-8');
require_once 'utf.php';
require_once 'library/config.php';
// if no order id defined in the session
// redirect to main page
if (!isset($_SESSION['orderId'])) {
header('Location: ' . WEB_ROOT);
exit;
}
$pageTitle = 'Checkout Completed Successfully';
require_once 'include/header.php';
// send notification email
if ($shopConfig['sendOrderEmail'] == 'y') {
$subject = "[New Order] " . $_SESSION['orderId'];
$email = $shopConfig['example@gmail.com'];
$message = "You have a new order. Check the order detail here \n http://" . $_SERVER['HTTP_HOST'] . WEB_ROOT . 'admin/order/index.php?view=detail&oid=' . $_SESSION['orderId'] ;
mail($email, $subject, $message, "From: $email\r\nReturn-path: $email");
}
unset($_SESSION['orderId']);
?>
<p> </p><table width="500" border="0" align="center" cellpadding="1" cellspacing="0">
<tr>
<td align="left" valign="top" bgcolor="#333333"> <table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" bgcolor="#EEEEEE"> <p> </p>
<p>Thank you for shopping with us! We will send the purchased
item(s) immediately. To continue shopping please <a href="index.php">click
here</a></p>
<p> </p></td>
</tr>
</table></td>
</tr>
</table>
<br>
<br>
<?php
require_once 'include/footer.php';
?>
Can you please tell me how to make it work?
Thank you!