Page 1 of 1

DATA not accepted from server after setting SMTP

Posted: Sat Feb 18, 2017 5:32 pm
by Xerobia
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.

Re: DATA not accepted from server after setting SMTP

Posted: Sun Feb 19, 2017 3:42 pm
by Xerobia
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.

Re: DATA not accepted from server after setting SMTP

Posted: Fri Feb 24, 2017 3:18 pm
by Xerobia
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.

Re: DATA not accepted from server after setting SMTP

Posted: Fri Feb 24, 2017 3:56 pm
by thekrotek
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.

Re: DATA not accepted from server after setting SMTP

Posted: Fri Feb 24, 2017 5:04 pm
by Xerobia
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.

Re: DATA not accepted from server after setting SMTP

Posted: Fri Feb 24, 2017 5:15 pm
by thekrotek
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;

Re: DATA not accepted from server after setting SMTP

Posted: Thu Aug 27, 2020 6:04 am
by ChrisEvans
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?