using the mail() function to send two messages one a checkout page, the first to the site owner letting him know that their has been a new purchase made on his site, the second to the customer as a follow - up confiming that their order was recieved and they should expect to recieve their order in x# of day's.
Below is the code I'm using, the strange thing I can't seem to overcome is this. THe first email get's sent to a staic addres...XYZ@hotmail.com or something, but it's not a variable it's coded directly into the script.
THe second email gets sent to the customers email taken from the customer list table in the database..so it's sent to say $CustEmail...This email will not send..I've tried sending only one and not the other, and everything else I can think of. I can only come up with their is a problem with this email address in a variable.
The Mail() function doesn't spit out any errors either. So it thinks it's completing the task I think.
Code:
FIRST MAIL()
$msgSubject = "placed by Customer: $user_logged";
$msgBody = " Customer ID: $user_logged\n
Customer name: $CustFirstName $CustLastName\n
Customer email: $CustEmail\n
Customer Address: $CustAddress\n\t$CustCity\n\t$CustPostal\n
Customer Tele: $CustPhone\n\n\n
Movie Information:\n
ID:$movie_1\n
ID:$movie_2\n
ID:$movie_3\n";
$Headers = "From: order@xyz.au.com\nX-Mailer: PHP/";
mail ('xyz@hotmail.com', $msgSubject, $msgBody, $Headers) or die("Mail could'nt send");
SECOND MAIL()
$mailToB = "$CustEmail";
$msgSubjectB = "Rental order confirmation";
$msgBodyB = "Confirmation of your order:";
echo "<p>$CustEmail<p>$msgSubjectB<p>$msgBodyB";
$xHeadersB = "From: order@xyz.au.com\nX-Mailer: PHP/";
mail (\"$CustEmail\", $msgSubjectB, $msgBodyB, $xHeaders😎 or die("Mail could'nt send");
Any ideas?