[Phpmailer-general] Incorrectly encoded headers
A full-featured email creation and transfer class for PHP
Brought to you by:
coolbru
From: Alexander K. <kar...@gm...> - 2007-11-21 01:19:34
|
Hi, I'd like to report a problem with a header encoding in PHPmailer. Problem description: Headers (From:, To:, Subject:) encoded incorrectly, at least when base64 encoding is used. If header string contains multibyte characters (UTF-8 charset, Cyrillic symbols for example), encoded header incorrecly split to 'encoded words'. Multibute symbol may be split and its parts may get to different 'encodoed words'. Incorrectly encoded headers are wrongly displayed in email clients, including Mozilla Thunderbird and The Bat. PHPmailer version: PHPMailer [version 1.71] Problem analysis: Function EncodeHeader first encodes a whole string with base64_encode, after that splits encoded string to chunks with chunk_split. Since string already encodoed, some multibute symbols may be split between a different words. Possible solution: Header string should be split to suitable parts first, when each part should be encoded. Regards, Alexander Karasev |