Post by seedbasket » Wed Jul 27, 2016 10:33 pm

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
Last edited by straightlight on Wed Jul 27, 2016 10:34 pm, edited 1 time in total.
Reason: Added quote tags.

Newbie

Posts

Joined
Wed Jul 27, 2016 10:27 pm

Post by straightlight » Wed Jul 27, 2016 10:35 pm

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

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by seedbasket » Wed Aug 03, 2016 9:22 pm

Please some one help me on fixing this issue

Newbie

Posts

Joined
Wed Jul 27, 2016 10:27 pm

Post by straightlight » Wed Aug 03, 2016 9:27 pm

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.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by seedbasket » Mon Aug 08, 2016 8:06 pm

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.

Newbie

Posts

Joined
Wed Jul 27, 2016 10:27 pm

Post by straightlight » Mon Aug 08, 2016 8:12 pm

Which OC version are you using?

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by straightlight » Mon Aug 08, 2016 8:17 pm

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.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by seedbasket » Tue Aug 09, 2016 1:02 am

Version: 2.2.0.0
straightlight wrote:Which OC version are you using?

Newbie

Posts

Joined
Wed Jul 27, 2016 10:27 pm

Post by seedbasket » Tue Aug 09, 2016 1:06 am

Will it work for my version:2.2.0.0
straightlight wrote: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.

Newbie

Posts

Joined
Wed Jul 27, 2016 10:27 pm

Post by straightlight » Tue Aug 09, 2016 3:21 am

seedbasket wrote:Will it work for my version:2.2.0.0
straightlight wrote: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.
Yes, this method is available under v2.2.0.0 release inclusively.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by seedbasket » Wed Aug 10, 2016 9:45 pm

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
straightlight wrote: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.
Yes, this method is available under v2.2.0.0 release inclusively.
Last edited by straightlight on Wed Aug 10, 2016 9:47 pm, edited 2 times in total.
Reason: Added code tags.

Newbie

Posts

Joined
Wed Jul 27, 2016 10:27 pm

Post by straightlight » Thu Aug 11, 2016 1:17 am

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.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON
Who is online

Users browsing this forum: No registered users and 5 guests