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

CommentFileSizeAuthor
#1 class.phpmailer.zip13.57 KBoptalgin

Comments

optalgin’s picture

Title: Allow subject field to support double byte characters » Allow subject field to support double byte characters (subject looks like =?utf-8?)
StatusFileSize
new13.57 KB

Leon 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

ravik’s picture

leon85321, thanks for your fix.
This also helped me in russian language site

wundo’s picture

Issue summary: View changes
Status: Active » Closed (works as designed)
ilfelice’s picture

Howdy,

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.