Emailing a Receipt ... Not Doing It
Using PowerStore 2, Dreamweaver CS3 on a Mac, with Universal Mail installed.
Checkout process is working fine. Had a bit of an issue with it but it's working fine now.
However, it's not emailing receipts. Was thinking it was the SMTP Mail Server I've told it to use (pop.buywineonline.com.au), but it sends off a Lost Password without any issues (with or without the SMTP server set) so I'm assuming the issue isn't that.
From the confirm page (confirm.php), lines 841 to 852 are as follows ...
<?php
if ((isset($_POST["Submit_order"]))) {
//WA Universal Email object="mail"
//Send Loop Once Per Entry
$RecipientEmail = "".((isset($_POST["email"]))?$_POST["email"]:"") ."";include("WA_Universal_Email/WAUE_confirm_1.php");
//Send Mail All Entries
if (""!="") {
header("Location: ");
}
}
?>
... the WAUE_confirm_1.php page uses the receipt.php page (in the Email_Templates directory) to build the body of the page. The WAUE_confirm_1.php page is as follows ...
<?php
$MailAttachments = "";
$MailBCC = "";
$MailCC = "";
$MailTo = "";
$MailBodyFormat = "";
$MailBody = "";
$MailImportance = "";
$MailFrom = "Buy Wine Online|WA|".($WAGLOBAL_Receipt_Email_FROM) ."";
$MailSubject = "".($WAGLOBAL_Receipt_Email_Subject) ."";
$_SERVER["QUERY_STRING"] = "";
//Global Variables
$WA_MailObject = WAUE_Definition("".($WAGLOBAL_Email_Server) ."","25","","","","");
if ($RecipientEmail) {
$WA_MailObject = WAUE_AddRecipient($WA_MailObject,$RecipientEmail);
}
else {
//To Entries
}
//Attachment Entries
//BCC Entries
$WA_MailObject = WAUE_AddBCC($WA_MailObject,"".($WAGLOBAL_Receipt_Email_BCC) ."");
//CC Entries
$WA_MailObject = WAUE_AddCC($WA_MailObject,"".($WAGLOBAL_Receipt_Email_CC) ."");
//Body Format
$WA_MailObject = WAUE_BodyFormat($WA_MailObject,2);
//Set Importance
$WA_MailObject = WAUE_SetImportance($WA_MailObject,"3");
//Start Mail Body
$MailBody = $MailBody . "";
ob_start();
require_once(dirname(__FILE__) . ("/Email_Templates/receipt.php"));
$contents = ob_get_clean();
$MailBody = $MailBody . "";
//End Mail Body
$WA_MailObject = WAUE_SendMail($WA_MailObject,$MailAttachments,$MailBCC,$MailCC,$MailTo,$MailImportance,$MailFrom,$MailSubject,$MailBody);
$WA_MailObject = null;
?>
... that's all "out of the box", except for the necessary alterations to replace PayPal with our local (Australian) Payment Gateway (eWay).
Any thoughts on why it won't email a receipt?
The trigger to send the email is set to "Button: Submit_order pressed" and comes after the Store Cart Details in Db section, which, when complete, does the redirection to checkout_success.php. That's just a thought, but once again, the "out of the box" version does the same thing and in that order.