kiwihawk Posted January 11, 2005 Share Posted January 11, 2005 I'm having trouble getting the email confirmation on checkout to work. This is the original code from checkout_process.php: tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); // send emails to other people if (SEND_EXTRA_ORDER_EMAILS_TO != '') { tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_TEXT_SUBJECT, $email_order, $order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address']); } But it doesn't work. Mail just disappears! However, if I make a small change by taking out the $email_order, and replace it with plain text, it works. Both the customer and store owner get the mail. For example: tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, 'This is where the order should go', STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); // send emails to other people if (SEND_EXTRA_ORDER_EMAILS_TO != '') { tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_TEXT_SUBJECT, 'This is where the order should go', $order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address']); } Any ideas what is in the $email_order coding that prevents the mail getting through? There is no errors coming up, it just disappears. My ISP has no spam filters in place, so it can't be that. Anyone? Link to comment Share on other sites More sharing options...
boxtel Posted January 11, 2005 Share Posted January 11, 2005 I'm having trouble getting the email confirmation on checkout to work. This is the original code from checkout_process.php: tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); // send emails to other people if (SEND_EXTRA_ORDER_EMAILS_TO != '') { tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_TEXT_SUBJECT, $email_order, $order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address']); } But it doesn't work. Mail just disappears! However, if I make a small change by taking out the $email_order, and replace it with plain text, it works. Both the customer and store owner get the mail. For example: tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, 'This is where the order should go', STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); // send emails to other people if (SEND_EXTRA_ORDER_EMAILS_TO != '') { tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_TEXT_SUBJECT, 'This is where the order should go', $order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address']); } Any ideas what is in the $email_order coding that prevents the mail getting through? There is no errors coming up, it just disappears. My ISP has no spam filters in place, so it can't be that. Anyone? <{POST_SNAPBACK}> instead of speculating, why don't you simply put a echo test in there: echo $order_email; so you can see what is in there and what the problem might be. Treasurer MFC Link to comment Share on other sites More sharing options...
kiwihawk Posted January 11, 2005 Author Share Posted January 11, 2005 instead of speculating, why don't you simply put a echo test in there: echo $order_email; so you can see what is in there and what the problem might be. <{POST_SNAPBACK}> It would appear that it does not like variables in the body of the message. For example, if I put in, EMAIL_TEXT_PRODUCTS, it returns the result of "Products" and the mail goes thru. But if I put in $products_ordered, no mail. Link to comment Share on other sites More sharing options...
boxtel Posted January 11, 2005 Share Posted January 11, 2005 It would appear that it does not like variables in the body of the message. For example, if I put in, EMAIL_TEXT_PRODUCTS, it returns the result of "Products" and the mail goes thru. But if I put in $products_ordered, no mail. <{POST_SNAPBACK}> they are no different, the problem probably lies with the content of $products_ordered. Treasurer MFC Link to comment Share on other sites More sharing options...
kiwihawk Posted January 12, 2005 Author Share Posted January 12, 2005 they are no different, the problem probably lies with the content of $products_ordered. <{POST_SNAPBACK}> After going thru the coding and removing each variable one at a time, I have discovered where the problem lies!! Its with the linebreaks! By removing all the \n out of the code on the checkout_process.php page, it sends the email. But as you can imagine, the email then has no linebreaks in it, which means all the information is on one continuous line. I have tried replacing the \n with \r\n but it doesn't like that either. I know there is a problem with linebreaks communicatiing with SMTP, but all the reading suggests that \r\n should work, but it doesn't. This in email.php should fix it, but nope! function email($headers = '') { if ($headers == '') $headers = array(); $this->html_images = array(); $this->headers = array(); if (EMAIL_LINEFEED == 'CRLF') { $this->lf = "\r\n"; } else { $this->lf = "\n"; } I've also tried using smtp and sendmail, both with either LF or CRLF from admin, but this doesn't help it. Do you know of any other method to force a line break? Link to comment Share on other sites More sharing options...
kiwihawk Posted January 13, 2005 Author Share Posted January 13, 2005 After going thru the coding and removing each variable one at a time, I have discovered where the problem lies!! Its with the linebreaks! By removing all the \n out of the code on the checkout_process.php page, it sends the email. But as you can imagine, the email then has no linebreaks in it, which means all the information is on one continuous line. I have tried replacing the \n with \r\n but it doesn't like that either. I know there is a problem with linebreaks communicatiing with SMTP, but all the reading suggests that \r\n should work, but it doesn't. This in email.php should fix it, but nope! function email($headers = '') { ? ? ?if ($headers == '') $headers = array(); ? ? ?$this->html_images = array(); ? ? ?$this->headers = array(); ? ? ?if (EMAIL_LINEFEED == 'CRLF') { ? ? ? ?$this->lf = "\r\n"; ? ? ?} else { ? ? ? ?$this->lf = "\n"; ? ? ?} I've also tried using smtp and sendmail, both with either LF or CRLF from admin, but this doesn't help it. Do you know of any other method to force a line break? <{POST_SNAPBACK}> Is there Anyone who can help on this?? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.