Mail to customer and admin - UTF-8 issue ?

MAC60

Avatar: MAC60

2010-03-13 21:01

Gents,

I do have an issue with one specific server, umlauts like ä, ö, ü are wrongly displayed (same script works flawlessly on another server). Furthermore, the mail to the customer and admin as well starts with:

Content-type: text/plain; charset=utf-8
Message-Id: <20100313182832.2EE0D1550548@ispcp.adminfrontend.de>
Date: Sat, 13 Mar 2010 18:28:32 +0000 (UTC)

Looks like the above content-type command is not processed but simply shown on the email body.

Any hints are highly appreciated.

Thanks

» Quick.Cart v3.x

MAC60

Avatar: MAC60

2010-03-13 21:02

I should have added that all the umlauts are properly shown within the shop, the url's too look perfectly alright.

thanks

MAC60

Avatar: MAC60

2010-03-14 16:27

Some improvements, but not sorted yet:

In core/common.php I changed the following line:
if( @mail( $sTargetEmail, $sTopic, $sMailContent, 'From: '.$sSender."\r\nContent-type: text/plain; charset=utf-8"\r\n ) ){

Change 1: deleted the first \r which resulted in the server accepting the Content-type UTF 8.

Change 2: deleted the \r\n after charset=utf-8 which resulted in not seeing the 2 text lines mentioned above (Message-ID: and Date)

The only problem that remains now is:
There is way too much space between the different lines in the email text, looks like there are too many "LF"s (or whatever) hidden somewhere.

Anybody able to help? Thanks a lot

beholder

Avatar: beholder

2010-03-14 17:19

there are two different problems with your QC implementation:
1. you probably didn't change the libraries/Trash.php in function change2Latin, where you need to include all your special characters as well as their latin counterparts.
2. There might be a real problem with file templates/orders_print.tpl. Please check that it is encoded in UTF-8 without BOM and that all lines end correctly with \r\n, not with \r\n\r\n. Notepad++ allows you to check both.

MAC60

Avatar: MAC60

2010-03-14 18:04

@beholder

Thanks for your input, I solved the problem now.

The issue wasn't the trash.php as I deleted change2Latin in function SendEmail (common.php)
And orders_print was encoded in UTF-8 without BOM.

Nevertheless you led me to the solution! I checked again if all lines in orders_print end with CR/LF (or \r\n), and they did! But in notepad++ I did find the possibility to convert the line ends to UNIX (LF only, no CR) and after this change the emails look neatly again, no unnecessary empty lines between the different variables.

Enjoy your evening

Back to top
about us | contact