Post by othercevans » Thu Aug 27, 2020 1:43 am

Hello
I have recently changed to SMTP email as I stopped receiving order confirmation emails and when I tested the contact page etc that wasn't working. Using the details from my host i changed to SMTP, tried the contact page, registered a new customer and was happy that it was working better than before.

Thought id try a test order and am getting the following error when registering as a new customer.

Syntax error: Unexpected token < in JSON at position 0 parsererror
<b> Fatal error</b>Error: DATA not accepted from server! </strong>'<br> in home/sites/mywebsite.co.uk/public_html/vickievans/system/library/mail.php:404

I have tried changing the settings for the SMTP but this just causes other errors.
PLEASE HELP

Newbie

Posts

Joined
Thu Aug 27, 2020 1:36 am

Post by paulfeakins » Thu Aug 27, 2020 6:57 pm

See this, but I'm not sure if there is a solution yet:
viewtopic.php?t=148895

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Legendary Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by ChrisEvans » Tue Sep 08, 2020 4:01 am

Just wanted to update on this.
Haunted @Straightlight about this for a few days and sent emails back and forth to hosting company. Still no fix, the hosting company think its OC code.
Ended up using MAIL function again and all was working for a few days until a customer highlighted she couldn't leave a review.

I have switched back to SMTP mail and when testing the website, it shows the Syntax Error- Unexpected token, when registering a new customer, even though the customer is generated in the database and the email is sent to them and to admin. If you press OK to clear the fault then press CONTINUE again it takes you to the next page. Obviously not all customers are going to do that or may not do that.

I have read the above posts but find I get out of my depth when reading GitHub posts

New member

Posts

Joined
Fri Sep 30, 2011 3:31 am

Post by ADD Creative » Tue Sep 08, 2020 7:33 am

While not the actual problem. It sounds like you still have display errors on. This can cause problems as a notice or a warning can cause some bigger problems than they would normally.

You need to switch off display errors in three places. In your php configuration (it should be off anyway, but best to check). Setting config_error_display to false in system/config/default.php. Switching off in the OpenCart settings.

Make sure error logging is still enabled and use the error log to see the actual errors.

The gist of those post seem to be to make sure your from address matches the SMTP username (or at least the domain) or settings being wrong.

What settings are you using and do you see the error for every mail sent?
Last edited by ADD Creative on Tue Sep 08, 2020 9:03 am, edited 1 time in total.

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by EvolveWebHosting » Tue Sep 08, 2020 8:06 am

othercevans wrote:
Thu Aug 27, 2020 1:43 am
Hello
I have recently changed to SMTP email as I stopped receiving order confirmation emails and when I tested the contact page etc that wasn't working. Using the details from my host i changed to SMTP, tried the contact page, registered a new customer and was happy that it was working better than before.

Thought id try a test order and am getting the following error when registering as a new customer.

Syntax error: Unexpected token < in JSON at position 0 parsererror
<b> Fatal error</b>Error: DATA not accepted from server! </strong>'<br> in home/sites/mywebsite.co.uk/public_html/vickievans/system/library/mail.php:404

I have tried changing the settings for the SMTP but this just causes other errors.
PLEASE HELP
I agree this is a coding related issue and very unlikely it's hosting / server related because you said the email was sent when you registered an account.

Opencart Hosting Plans, Domain Registration, Microsoft and Google Email and More
Visit our website for great deals and most importantly, fast and friendly support - www.evolvewebhosting.com


User avatar
Active Member

Posts

Joined
Fri Mar 27, 2015 11:13 pm
Location - Denver, Colorado, USA

Post by ChrisEvans » Wed Sep 09, 2020 12:56 am

ADD Creative wrote:
Tue Sep 08, 2020 7:33 am
While not the actual problem. It sounds like you still have display errors on. This can cause problems as a notice or a warning can cause some bigger problems than they would normally.

You need to switch off display errors in three places. In your php configuration (it should be off anyway, but best to check). Setting config_error_display to false in system/config/default.php. Switching off in the OpenCart settings.

Make sure error logging is still enabled and use the error log to see the actual errors.

The gist of those post seem to be to make sure your from address matches the SMTP username (or at least the domain) or settings being wrong.

What settings are you using and do you see the error for every mail sent?
Thanks for taking time to reply! :)
I have switched off display errors in the settings, have just edited system/config/default.php ..how do I check my php configuration?
I did try changing my php version but found it caused yet more errors so reverted back to initial version.

Settings being used are
Mail Protocol - SMTP
Mail Parameters - -finfo@vickievans.co.uk
SMTP Hostname mail38.extendcp......
SMTP Username email address
SMTP Password - triple checked its correct
SMTP Port 587
SMTP Timeout 60 (was 5 but changed to 60 as per another post)

Currently noticing the issue when registering customers, when you submit a review the page just crashes although just tried it and it works.

I was running this site on 34sp servers but it was costing too much so switched it to my other hosting account as 34sp only allow 1 domain. I had SSL certificate with 34sp and since moving I have had to use Cloudflare for my SSL, not sure if Cloudflare is affecting it. It seems to be playing nicely at the minute, will do some more testing later.

Would it be worth upgrading from 2.2.0 to a later version as someone said the SMTP errors were rectified then?

New member

Posts

Joined
Fri Sep 30, 2011 3:31 am

Post by ADD Creative » Wed Sep 09, 2020 2:42 am

You can use <?php phpinfo(); ?> in a php files to see your settings. display_errors is the setting you need to check is off.

What PHP version are you currently using?

Does your from email address (i.e. the one set as your store's contact address) match your SMTP Username?

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by ChrisEvans » Wed Sep 09, 2020 4:42 am

ADD Creative wrote:
Wed Sep 09, 2020 2:42 am
You can use <?php phpinfo(); ?> in a php files to see your settings. display_errors is the setting you need to check is off.

What PHP version are you currently using?

Does your from email address (i.e. the one set as your store's contact address) match your SMTP Username?
The only difference in the email is the -f

php version is 7.0 there is the option of 7.1 and 7.2

New member

Posts

Joined
Fri Sep 30, 2011 3:31 am

Post by ADD Creative » Wed Sep 09, 2020 6:51 am

What emails are still failing to send (register,order, contact, review, etc.)? Or are the email being sent but the form is failing show the success page? Do these fail every time? What entries do you see in your error logs (OpenCart and server PHP logs) at the time they fail?

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom
Who is online

Users browsing this forum: No registered users and 18 guests