Page 1 of 1
am getting application error while working on my website re
Posted: Wed Jul 27, 2016 10:33 pm
by seedbasket
Am getting below error when I do any action which will send mail, I am not getting this error every time, its very un predictable .
getting error some time user try to register, Or when admin try to update the order status from admin panel.
SyntaxError: Unexpected token < in JSON at position 0OK<br /><b>Fatal error</b>: Uncaught exception 'Exception' with message 'Error: DATA not accepted from server!' in /home/srinav5/public_html/seedbasket.in/system/library/mail.php:404Stack trace:#0 /home/srinav5/public_html/seedbasket.in/catalog/model/checkout/order.php(804): Mail->send()#1 [internal function]: ModelCheckoutOrder->addOrderHistory('16', '3', 'We've dispatche...', '1', '0')#2 /home/srinav5/public_html/seedbasket.in/system/storage/modification/system/engine/loader.php(150): call_user_func_array(Array, Array)#3 [internal function]: Loader->{closure}(Array)#4 /home/srinav5/public_html/seedbasket.in/system/engine/proxy.php(13): call_user_func(Object(Closure), Array)#5 /home/srinav5/public_html/seedbasket.in/catalog/controller/api/order.php(821): Proxy->__call('addOrderHistory', Array)#6 /home/srinav5/public_html/seedbasket.in/catalog/controller/api/order.php(821): Proxy->addOrderHistory('16', '3', 'We've dispatche...', '1', '0')#7 [internal function]: ControllerApiOrder->history()#8 /home/srinav5/public_html/seedbask in <b>/home/srinav5/public_html/seedbasket.in/system/library/mail.php</b> on line <b>404</b><br />
Please help me
Re: am getting application error while working on my website
Posted: Wed Jul 27, 2016 10:35 pm
by straightlight
Welcome to the Opencart forum. Followed are explicit details about email errors you might receive from your stores:
http://forum.opencart.com/viewtopic.php ... 57#p630707
Re: am getting application error while working on my website
Posted: Wed Aug 03, 2016 9:22 pm
by seedbasket
Please some one help me on fixing this issue
Re: am getting application error while working on my website
Posted: Wed Aug 03, 2016 9:27 pm
by straightlight
seedbasket wrote:Please some one help me on fixing this issue
The solution was already provided on the addressed topic:
In order to fix this issue, the mail parameters entered to the form must be properly filled.
Re: am getting application error while working on my website
Posted: Mon Aug 08, 2016 8:06 pm
by seedbasket
Dear straightlight,
I have gone through the link you provided, but it doesn't help me.
I have entered the mail parameters properly .
I am not getting the error all the time, out of 10 customers 2-3 customers are getting the error while registering their account with system , some time user checkout and made payment, some time as admin when I update the status of order from one status to other status and notify customer checkbox checked , getting this error.
In all the above cases system trying to send the mail to user.
When I contacted customer support of my hosting server(InMotion) about my issue , there were saying 'as this error is not always while mail send, issue should be from you are code i/e opencart)
I am help less with this issue and loosing my business.
Please help me.
My website address:
www.seedbasket.in
you can reproduce the issue by registering into the application from mobile browser(50% more chance to get error message from mobile browser than desktop browser)
Thanks
Naveen G
straightlight wrote:seedbasket wrote:Please some one help me on fixing this issue
The solution was already provided on the addressed topic:
In order to fix this issue, the mail parameters entered to the form must be properly filled.
Re: am getting application error while working on my website
Posted: Mon Aug 08, 2016 8:12 pm
by straightlight
Which OC version are you using?
Re: am getting application error while working on my website
Posted: Mon Aug 08, 2016 8:17 pm
by straightlight
Followed is a part-solution that may resolved the issue:
http://forum.opencart.com/viewtopic.php ... to#p583400
In your case, you'd need to add the suggested code line in each locations to where the emails needs to be sent.
Re: am getting application error while working on my website
Posted: Tue Aug 09, 2016 1:02 am
by seedbasket
Version: 2.2.0.0
straightlight wrote:Which OC version are you using?
Re: am getting application error while working on my website
Posted: Tue Aug 09, 2016 1:06 am
by seedbasket
Will it work for my version:2.2.0.0
Re: am getting application error while working on my website
Posted: Tue Aug 09, 2016 3:21 am
by straightlight
seedbasket wrote:Will it work for my version:2.2.0.0
Yes, this method is available under v2.2.0.0 release inclusively.
Re: am getting application error while working on my website
Posted: Wed Aug 10, 2016 9:45 pm
by seedbasket
HI,
I am doing below changes as per your link, Please confirm my changes
At system/library/mail.php Replaced following line of code
Code: Select all
$header .= 'From: =?UTF-8?B?' . base64_encode($this->sender) . '?= <' . $this->from . '>' . PHP_EOL;
if (!$this->reply_to) {
$header .= 'Reply-To: =?UTF-8?B?' . base64_encode($this->sender) . '?= <' . $this->from . '>' . PHP_EOL;
}
else {
$header .= 'Reply-To: =?UTF-8?B?' . base64_encode($this->reply_to) . '?= <' . $this->reply_to . '>' . PHP_EOL;
}
With
Code: Select all
$header .= 'From: =?UTF-8?B?' . base64_encode($this->sender) . '?=' . ' <' . $this->from . '>' . $this->newline;
$header .= 'Reply-To: =?UTF-8?B?' . base64_encode($this->sender) . '?=' . ' <' . $this->replyto . '>' . $this->newline;
At catalog/controller/information/contact.php Replaced following line of code
Code: Select all
$mail->setTo($this->config->get('config_email'));
$mail->setFrom($this->request->post['email']);
$mail->setSender(html_entity_decode($this->request->post['name'], ENT_QUOTES, 'UTF-8'));
With
$mail = new Mail($this->config->get('config_mail'));
$mail->setTo($this->config->get('config_email'));
$mail->setFrom( 'email'');
$mail->setSender($this->request->post['name']);
$mail->setReplyTo($this->request->post['email']);
Thanks,
Naveen G
straightlight wrote:seedbasket wrote:Will it work for my version:2.2.0.0
Yes, this method is available under v2.2.0.0 release inclusively.
Re: am getting application error while working on my website
Posted: Thu Aug 11, 2016 1:17 am
by straightlight
I would suggest to ask the question on the pointed topic. However,
Code: Select all
$mail = new Mail($this->config->get('config_mail'));
from the replacement codes should not be there since the previous codes before your replacement does not have the Mail class.