Hello,
I have been using this module for a while. I had a problem with sending double byte characters such as chinese using UTF-8 encoding.
The subject becomes unreadable strings like this
"=?utf-8?B?5Lit5paH5ris6Kmm5LqU5YWt5LiD5YWr5Lmd5Y2B5LiA55u05L6G5ris6Kmm"
when the subject has strings has a lot double byte characters, (more than 12 or 14 i think).
I have found out that the problem is because of phpmailer itself.
After searching on the web, I have found a solution to solve this problem.
Change line 920 of class.phpmailer.php
$result .= $this->HeaderLine('Subject', $this->EncodeHeader($this->SecureHeader($this->Subject)));
To
$result .= $this->HeaderLine('Subject', $this->EncodeHeader($this->SecureHeader($this->Subject),'text', 1));
And change line 1299 of class.phpmailer.php
public function EncodeHeader ($str, $position = 'text') {
To
public function EncodeHeader ($str, $position = 'text', $pl = 0) {
if ( $pl ) return "=?" . $this->CharSet . "?B?" . base64_encode($str) . "?=";
And then change line 51 $CharSet = 'UTF-8';
And line 64 $Encoding = 'base64';
So far the subject displays the double byte characters without problem.
Hope this helps.
Leon
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | class.phpmailer.zip | 13.57 KB | optalgin |
Comments
Comment #1
optalgin commentedLeon thanks...
Your solution helped me
To make it easier for other users to this solution
I've included an attachment of this patch..
Patched PHPMailer version 2.3
Comment #2
ravik commentedleon85321, thanks for your fix.
This also helped me in russian language site
Comment #3
wundo commentedComment #4
ilfelice commentedHowdy,
Has the solution posted here been ever integrated into the module?
I ask because I am seeing this problem when sending messages using SMTP via Postmark, and was wondering if it may be the same issue or a separate one.