Post by Xerobia » Sat Feb 18, 2017 5:32 pm

Recently i switched the mail protocol to SMTP, It happens around 70% of the time when updating an order.
How can this be fixed?

Opencart 2.2.0.0
SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data

OK

<br />
<b>Fatal error</b>: Uncaught exception 'Exception' with message 'Error: DATA not accepted from server!' in /xxx/xxx/xxx/html/system/library/mail.php:404
Stack trace:
#0 /xxx/xxx/xxx/html/catalog/model/checkout/order.php(804): Mail-&gt;send()
#1 [internal function]: ModelCheckoutOrder-&gt;addOrderHistory('3511', '3', '', '1', '0')
#2 /xxx/xxx/xxx/html/system/storage/modification/system/engine/loader.php(150): call_user_func_array(Array, Array)
#3 [internal function]: {closure}(Array)
#4 /xxx/xxx/xxx/html/system/engine/proxy.php(13): call_user_func(Object(Closure), Array)
#5/xxx/xxx/xxx/html/catalog/controller/api/order.php(821): Proxy-&gt;__call('addOrderHistory', Array)
#6 /xxx/xxx/xxx/html/catalog/controller/api/order.php(821): Proxy-&gt;addOrderHistory('3511', '3', '', '1', '0')
#7 [i in <b>/xxx/xxx/xxx/html/system/library/mail.php</b> on line <b>404</b><br />
Thank you.

New member

Posts

Joined
Sun Jul 15, 2012 12:51 pm

Post by Xerobia » Sun Feb 19, 2017 3:42 pm

Does nobody else have this problem with SMTP? I'm running an unmodified 2.2.0.0 core version.
I'm willing to pay for a solution.

New member

Posts

Joined
Sun Jul 15, 2012 12:51 pm

Post by Xerobia » Fri Feb 24, 2017 3:18 pm

If anyone has any thoughts how to fix this problem, please let me know.

I'm running an unmodified version of OC 2.2.0.0 so i find it strange that nobody is having the same problem.

New member

Posts

Joined
Sun Jul 15, 2012 12:51 pm

Post by thekrotek » Fri Feb 24, 2017 3:56 pm

There's nothing wondrous in others not having this issue, because data not accepted by SERVER. Which means, the problem is very much local. There's no problem in changing order status, there's a problem with your SMTP server. Contact your hosting provider on the matter.

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member

Posts

Joined
Sun Jul 03, 2016 12:24 am


Post by Xerobia » Fri Feb 24, 2017 5:04 pm

My webhost acts like it's a script-related problem, they don't want to acknowledge it's server-side.

I found this thread viewtopic.php?t=45585 from November 2011, someone running OC 1.5.1.3 with the same problem.
Some code changes were suggested which seemed to work, but the core code has been changed so that fix isn't valid any longer.
ciprianrpp wrote:SOLVED
the OC 1.5.1.3 mail.php file (located in system/library/):

Code: Select all
$header .= 'Content-Type: multipart/related; boundary="' . $boundary . '"' . $this->newline;

the fix is to add another \n to separate header, so the correct code is:

Code: Select all
$header .= 'Content-Type: multipart/related; boundary="' . $boundary . '"' . $this->newline . $this->newline;

Edit: The fix mentioned above has been already integrated in the core code as bugfix. But it's hasn't solved the problem for me.

New member

Posts

Joined
Sun Jul 15, 2012 12:51 pm

Post by thekrotek » Fri Feb 24, 2017 5:15 pm

In OC 2.2 this part of code is already corrected:

Code: Select all

$header .= 'Content-Type: multipart/related; boundary="' . $boundary . '"' . PHP_EOL . PHP_EOL;

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member

Posts

Joined
Sun Jul 03, 2016 12:24 am


Post by ChrisEvans » Thu Aug 27, 2020 6:04 am

I am having this issue now after recently changing to SMTP as the mail function stopped working. I thought it was working better as we started getting order confirmation emails and I managed to send a newsletter out for the first time.
But when I have tried to register a new customer tonight it throws this error up. I have noticed that the customer is created in admin. I spoke to my hosting company and they said I was using the correct SMTP details and that its an OC issue. Have tried other SMTP settings but they just create more errors. I'm running 2.2.0 with the Pavilion theme.
Did you ever find a fix?

New member

Posts

Joined
Fri Sep 30, 2011 3:31 am
Who is online

Users browsing this forum: Amazon [Bot] and 60 guests