Jump to content

An Error Occurred While Sending An Email To The Customer


Prskavka

Recommended Posts

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

  • 3 weeks later...
  • 2 weeks later...

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 by rdaniel2p (see edit history)
Link to comment
Share on other sites

@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

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

 

ps_order_state_lang.jpg

 

 

mail-templates.jpg

 

 

So match them up and it fixes it .

 

Cheers

Link to comment
Share on other sites

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:

 

post-29199-0-48426300-1459322658_thumb.png

 

 

Link to comment
Share on other sites

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

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

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

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

  • 2 weeks later...

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

  • 1 month later...

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

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

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

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

  • 6 months later...

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

  • 6 years later...

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...