Prskavka Posted February 16, 2016 Share Posted February 16, 2016 Hi, my prestashop version is 1.6.0.1. Until yesterday, all worked fine. Then, in the afternoon, I copied the tracking numbers and suddenly "An error occurred while sending an email to the customer." I used php mail function. Now I try to set my smtp server, test e-mail went ok, but sending e-mails to customers not (I get error message above). I went to php mail function again, test message ok, e-mail to customer, I get the error message. One of my custommers wrote me, she became the same mail 2times, but my testcustomer recieved nothing. What could be wrong? I tried to reset mail alert module with no luck. Link to comment Share on other sites More sharing options...
NemoPS Posted February 17, 2016 Share Posted February 17, 2016 (edited) Which emails are not being sent to the customer?The ones with the tracking number?You can try to turn on dev mode (see my signature) and check for a specific error, if there's any Edited February 17, 2016 by Nemo1 (see edit history) Link to comment Share on other sites More sharing options...
dragohmsbreath Posted March 9, 2016 Share Posted March 9, 2016 Hi, did you find a solution? I started having the same problem since yesterday. Link to comment Share on other sites More sharing options...
dragohmsbreath Posted March 11, 2016 Share Posted March 11, 2016 Seems to have solved itself. Link to comment Share on other sites More sharing options...
rdaniel2p Posted March 22, 2016 Share Posted March 22, 2016 (edited) i have the same issue, in the orders panels show the error : An error occurred while sending the e-mail to the customer. when we trying to send or resend a order status We have prestashop vers 1.6.1.3 in the php log error we found this error : Division by zero in /home/drgood5/public_html/tools/smarty/sysplugins/smarty_internal_templatebase.php(157) : eval()'d code on line 75 PHP Notice: Undefined index: column in /home/drgood5/public_html/tools/smarty/sysplugins/smarty_internal_templatebase.php(157) : eval()'d code on line 75 PHP Notice: Trying to get property of non-object in /home/drgood5/public_html/tools/smarty/sysplugins/smarty_internal_templatebase.php(157) : eval()'d code on line 75 Edited March 22, 2016 by rdaniel2p (see edit history) Link to comment Share on other sites More sharing options...
NemoPS Posted March 23, 2016 Share Posted March 23, 2016 @rdaniel2p, are other emails going through without issues?You might want to check the emails for the back office language are actually in the mails/(iso of the bo language) folder Link to comment Share on other sites More sharing options...
dragohmsbreath Posted March 24, 2016 Share Posted March 24, 2016 When I try a few times it eventually works. Still not sure what's causing the error. Seems we all started to have the error around the same time which is weird. Link to comment Share on other sites More sharing options...
rdaniel2p Posted March 24, 2016 Share Posted March 24, 2016 @rdaniel2p, are other emails going through without issues? You might want to check the emails for the back office language are actually in the mails/(iso of the bo language) folder Hi @Nemo1 The test emails sent trough admin\advanced parameters\emails are recived, but the customers dit not received all the emails sent when submit a order or when in the back panels we update the order's status. In the folder mails/en are the templates for each order status Link to comment Share on other sites More sharing options...
HellGamer Posted March 29, 2016 Share Posted March 29, 2016 The solution was simple for me to find. You need to look in your database using phpmyadmin, look for ps_order_state_lang here are the details for all of the possible order states. Mine had several missing including in_transit which is the name of the template in public_html/mails/en See the images it's easier to understand So match them up and it fixes it . Cheers Link to comment Share on other sites More sharing options...
leonidnk Posted March 29, 2016 Share Posted March 29, 2016 "So match them up and it fixes it" - How? Sorry, but I cannot understand how I have to match them? Ragards Link to comment Share on other sites More sharing options...
leonidnk Posted March 30, 2016 Share Posted March 30, 2016 Hi, I got the same problem "An error occurred while sending an email to the customer". And my ps_order_state_lang table has several missing including in_transit. Almost as yours, HellGamer. How it is possible to fix the missed templates? My ps_order_state_lang table is below: Link to comment Share on other sites More sharing options...
HellGamer Posted March 30, 2016 Share Posted March 30, 2016 (edited) Hi.I can see from your table you should have a template called shipped. Have a look in your mails/ folder there will be folders for your languages and in there are your templates. If there is not a template called shipped then that is your problem. Edited April 8, 2016 by HellGamer (see edit history) Link to comment Share on other sites More sharing options...
leonidnk Posted March 30, 2016 Share Posted March 30, 2016 Hi, Thanks for the answer. I have two languages (EN, SV) och both folders contain "shipped" templates. Link to comment Share on other sites More sharing options...
HellGamer Posted March 30, 2016 Share Posted March 30, 2016 Ok. I am sorry but my solution I think is not good for your case It seems you have a different issue. Link to comment Share on other sites More sharing options...
dragohmsbreath Posted April 6, 2016 Share Posted April 6, 2016 Was going to debug on my localhost, but it works fine on the localhost with same email setup. It' definitely not an order state setup issue as stopped working from one day to the next without me changing anything. I did double check just in case, but all email files and states are setup correctly. Link to comment Share on other sites More sharing options...
dragohmsbreath Posted April 6, 2016 Share Posted April 6, 2016 The issue is in the AdminOrdersController.php line 440. The test returns false for some reason I cannot figure out. I forced the condition to true and tracking is now being sent. if(@Mail::Send((int)$order->id_lang, 'in_transit', Mail::l('Package in transit', (int)$order->id_lang), $templateVars, $customer->email, $customer->firstname.' '.$customer->lastname, null, null, null, null, _PS_MAIL_DIR_, true, (int)$order->id_shop)) Link to comment Share on other sites More sharing options...
NemoPS Posted April 8, 2016 Share Posted April 8, 2016 That's the "die" parameter, it should kill the process if anything goes wrong. Really odd Link to comment Share on other sites More sharing options...
Prskavka Posted April 8, 2016 Author Share Posted April 8, 2016 Hi, did you find a solution? I started having the same problem since yesterday. It was a fault of my hosting provider .. they solved their problem, so my problem was solved too Link to comment Share on other sites More sharing options...
dtwfung Posted April 11, 2016 Share Posted April 11, 2016 Hi, my prestashop version is 1.6.0.1. Until yesterday, all worked fine. Then, in the afternoon, I copied the tracking numbers and suddenly "An error occurred while sending an email to the customer." I used php mail function. Now I try to set my smtp server, test e-mail went ok, but sending e-mails to customers not (I get error message above). I went to php mail function again, test message ok, e-mail to customer, I get the error message. One of my custommers wrote me, she became the same mail 2times, but my testcustomer recieved nothing. What could be wrong? I tried to reset mail alert module with no luck. I'm using 1.6.0.14. I got similar problem (see below with error) when I updated order status (update to "Shipped"). in the orders panels show the error : An error occurred while sending the e-mail to the customer. The order status shows different in individual order and "BO-> order" page But, I check the message did send out to customer. I tried yesterday with operation. No error. I got similar error sometimes ago (duplicate error but no "An error occurred while sending the e-mail to the customer." ) After I clear cache, no error again. WHen does the max. number 2109 store ?! Error: [PrestaShopDatabaseException] Duplicate entry '2109' for key 'PRIMARY' INSERT INTO `t3e_order_history` (`id_order`, `id_order_state`, `id_employee`, `date_add`) VALUES ('155', '4', '1', '2016-04-11 14:42:17') at line 646 in file classes/db/Db.php 641. WebserviceRequest::getInstance()->setError(500, ' '.$this->getMsgError().'. From '.(isset($dbg[3]['class']) ? $dbg[3]['class'] : '').'->'.$dbg[3]['function'].'() Query was : '.$sql, 97);642. }643. elseif (_PS_DEBUG_SQL_ && $errno && !defined('PS_INSTALLATION_IN_PROGRESS'))644. {645. if ($sql)646. throw new PrestaShopDatabaseException($this->getMsgError().'<br /><br /><pre>'.$sql.'</pre>');647. throw new PrestaShopDatabaseException($this->getMsgError());648. }649. }650. 651. /**DbCore->displayError - [line 340 - classes/db/Db.php] - [1 Arguments]DbCore->query - [line 620 - classes/db/Db.php] - [1 Arguments]DbCore->q - [line 405 - classes/db/Db.php] - [2 Arguments]DbCore->insert - [line 486 - classes/ObjectModel.php] - [3 Arguments]ObjectModelCore->add - [line 454 - classes/order/OrderHistory.php] - [1 Arguments]OrderHistoryCore->add - [line 380 - classes/order/OrderHistory.php] - [1 Arguments]OrderHistoryCore->addWithemail - [line 528 - controllers/admin/AdminOrdersController.php] - [2 Arguments]AdminOrdersControllerCore->postProcess - [line 171 - classes/controller/Controller.php]ControllerCore->run - [line 373 - classes/Dispatcher.php]DispatcherCore->dispatch - [line 54 - admin/index.php] Link to comment Share on other sites More sharing options...
NemoPS Posted April 11, 2016 Share Posted April 11, 2016 It would seem your last order id is 154, so the next one is 155 (being added).Can you check the table and see where that 2109 is coming from? Link to comment Share on other sites More sharing options...
dtwfung Posted April 12, 2016 Share Posted April 12, 2016 It would seem your last order id is 154, so the next one is 155 (being added). Can you check the table and see where that 2109 is coming from? Update the status of order 154 will add a row with NEW order_history_id (NEXT available number) with same order_id. 2109 here refers as order_history_id but somehow the error shows the operation detect 2109 is the next available order_history_id but 2109 has already been used. I don't know why. The error occurs in random. Before, I can fixed by clearing cach. I cleare the cache and tried updated status of another order. This error occured again. Just few minutes ago, I tried to update another five orders. Five operations work smoothly without any error ! Really don't know ! Link to comment Share on other sites More sharing options...
Pez Posted April 25, 2016 Share Posted April 25, 2016 I've got the same issue since upgrading to 1.6.1.5. My host just told me to go to Advance Parameters > Email and change the SMTP server from the server name to the server's actual IP address, and that cured the problem! Not sure why, but it works now. Link to comment Share on other sites More sharing options...
WEMS Posted May 27, 2016 Share Posted May 27, 2016 We have migrated many customers from old shop. The goal is to send an email reset link to the customers. Yesterday this function was working well and today, not. I have activated debug mode and have many issues. I really don't understand why prestashop bug like that. I absolutely not edit the template manually, nothing. Please help Link to comment Share on other sites More sharing options...
NemoPS Posted May 27, 2016 Share Posted May 27, 2016 Are you using any module to send that in bulk? Or is it something you developed? Link to comment Share on other sites More sharing options...
WEMS Posted May 27, 2016 Share Posted May 27, 2016 For the moment I only try over the "forgot your password?" and there I get the error message There is 1 error An error occurred while sending the email. Link to comment Share on other sites More sharing options...
WEMS Posted May 27, 2016 Share Posted May 27, 2016 In "advanced settings" I use "Use PHP's mail() function (recommended; works in most cases)" when I try to send a test email to the shop mail address I get the following error: Error: Please check your configuration Link to comment Share on other sites More sharing options...
NemoPS Posted May 27, 2016 Share Posted May 27, 2016 What is the store's email compared to the domain? If it's not the same one, it might be dying because of that, likeemail: [email protected]store: nemosomethingelse.com Link to comment Share on other sites More sharing options...
WEMS Posted May 27, 2016 Share Posted May 27, 2016 we are using same domain email Link to comment Share on other sites More sharing options...
NemoPS Posted May 27, 2016 Share Posted May 27, 2016 With debug mode enabled, open the network tab, then click to send the email. See if any error is spawned in the response Link to comment Share on other sites More sharing options...
WEMS Posted May 27, 2016 Share Posted May 27, 2016 You mean the Advanced Parameters -> E-mail tab ? When yes, debug mode activated, browser cache deleted, no error show from debug mode but still have the same error: Error: Please check your configuration Link to comment Share on other sites More sharing options...
NemoPS Posted May 27, 2016 Share Posted May 27, 2016 I mean hit f12 on chrome, tab to "network" and see what the response of the emails sending ajax call is Link to comment Share on other sites More sharing options...
WEMS Posted May 27, 2016 Share Posted May 27, 2016 I'm on a mac and F12 do not work for me Link to comment Share on other sites More sharing options...
NemoPS Posted May 27, 2016 Share Posted May 27, 2016 no idea of the keystroke for mac, just bring up the dev console on chrome or firebug in firefox Link to comment Share on other sites More sharing options...
WEMS Posted May 27, 2016 Share Posted May 27, 2016 I find the solution. My Customers Hosting Server have a limit of the PHP Mail sending and I reach the limit. As the Hosting advice, I was able to configure the Mail settings with SMTP credential and all the mail functions are working again. Thanks for your help and fast reply ! Link to comment Share on other sites More sharing options...
netamis Posted December 26, 2016 Share Posted December 26, 2016 "An error occurred while sending the e-mail to the customer." only for order_confirmation, no matter is from website or try to resent the email from back-end. For all the other statuses emails are working fine. I am using Prestashop 1.6.1.5 Link to comment Share on other sites More sharing options...
netamis Posted December 26, 2016 Share Posted December 26, 2016 After digging a little, I found that file order_conf.txt was missing. The email is sent now, but the content is not correct. Variable {date}; {payment}; {products};{discounts};{total_products}; {total_discounts};{total_shipping} {carrier};{delivery_block_html};{invoice_block_html} are dispayed as text instead of correct value. Thus valiable {first_name}, {name} and {order} worked correct. Any idea how can I fix this? In folder mail I have files: order_conf.html, order_conf.txt; order_conf_cart_rules.tpl, order_conf_cart_rules.txt, order_conf_product_list.tpl, order_conf_product_list.txt. Link to comment Share on other sites More sharing options...
bhuvanesh98 Posted January 2, 2023 Share Posted January 2, 2023 Found the Solution Go to Step 1 => Advanced Parameters > E-mail Step 2 => Send emails to > Select Web Master Select - Set my own SMTP parameters (for advanced users ONLY) Step 3 => Give your mail server domain name in my case it was (main.mydomainname.com) Save and go to orders and check try to send mail now it will work for sure.... Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now