Post by tomeda » Sun May 14, 2017 11:19 pm

Hi,

My mail settings are like this:
SMTP
ssl://mail.example.com
465
user@example.com
password

I'm receiving emails but I see not correct encoding in part of my messages:

https://drive.google.com/file/d/0BzPa5u ... p=drivesdk

I'm using OC 1.5.6.1

Thanks for any information that can point me to fix this issue!

OpenCart SEO Services
http://tomeda.bg


User avatar
New member

Posts

Joined
Thu Mar 19, 2015 4:48 am


Post by ADD Creative » Tue May 16, 2017 11:31 pm

If you view the email source what is the charset set to on the Content-Type: lines of each part on the email?

ADD Creative - Web development and e-commerce development, Milton Keynes or Christchurch, UK
ADD Filtration - HVAC Panel Filters, Bag Filters and HEPA Filters


Active Member

Posts

Joined
Sat Jan 14, 2012 1:02 am

Post by tomeda » Wed May 17, 2017 1:55 am

It's UTF-8 but something goes wrong https://drive.google.com/file/d/0BzPa5u ... p=drivesdk

OpenCart SEO Services
http://tomeda.bg


User avatar
New member

Posts

Joined
Thu Mar 19, 2015 4:48 am


Post by ADD Creative » Wed May 17, 2017 9:44 pm

Have you checked the source of that text? It could be the error is in the language file or database. What characters are meant to be there? It might not show in a web browser and only in an email. Have you tried deleting and retyping that section?

ADD Creative - Web development and e-commerce development, Milton Keynes or Christchurch, UK
ADD Filtration - HVAC Panel Filters, Bag Filters and HEPA Filters


Active Member

Posts

Joined
Sat Jan 14, 2012 1:02 am

Post by tomeda » Thu May 18, 2017 1:20 am

I've checked it many times rewrited it at all, nothing changed. I've even changed that text with a new one the problem still exist. When I go back to mail setting and put mail protocol to "mail" it works just fine when I switch to "SMTP" problem exist.

OpenCart SEO Services
http://tomeda.bg


User avatar
New member

Posts

Joined
Thu Mar 19, 2015 4:48 am


Post by ADD Creative » Fri May 19, 2017 12:36 am

I have sort of manage to recreate the problem by having a line in the email over 998 bytes in length. Note it's bytes in length not characters.

The problem seems to be that when sending the email via SMTP the lines are split into 998 byte chunks using str_split. https://github.com/opencart/opencart/bl ... l.php#L356

str_split is not UTF-8 safe so could cut the line in the middle of a UTF-8 character byte sequence, causing the error.

A way around it may be to ensure that no lines are over 998 bytes long by adding line breaks ("\n") to the source of the text or simplifying the HTML content.

ADD Creative - Web development and e-commerce development, Milton Keynes or Christchurch, UK
ADD Filtration - HVAC Panel Filters, Bag Filters and HEPA Filters


Active Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Who is online

Users browsing this forum: No registered users and 15 guests