[TYPO3] TCDirectmail UTF8 sybject header problem

Daniel Schledermann daniel at typoconsult.dk
Thu Jan 18 11:56:46 CET 2007


Gideon So wrote:
> Hi,
> 
> 	I installed tcdirectmail and it works great. The only thing annoys me
> is that the utf8 (Chinese) subject header is broken. Anyone knows of
> this problem and is there a fix for this??

Hi Gideon

I'm aware of the problem. We mainly have the problem with special latin
characters such as åæø. The solution seem to be (as Dmitry proposed)
using qouted-printable encoding with the mb_encode_mimeheader
(http://www.php.net/manual/en/function.mb-encode-mimeheader.php) funtion.

In the meantime you can patch it yourself in
class.tx_tcdirectmail_mailer.php around line 800, and replace this

/* Mail it */
if ($sendmail_params) {
  mail ($receiverRecord['email'], $this->title, implode("\n", $body),
implode("\n", $headers), $sendmail_params);
} else {
  mail ($receiverRecord['email'], $this->title, implode("\n", $body),
implode("\n", $headers));
}

With this:

/* Mail it */
$title = mb_encode_mimeheader($this->title, $charset, 'Q');

if ($sendmail_params) {
   mail ($receiverRecord['email'], $title, implode("\n", $body),
implode("\n", $headers), $sendmail_params);
} else {
   mail ($receiverRecord['email'], $title, implode("\n", $body),
implode("\n", $headers));
}

This change will have effect from the next release of tcdirectmail.

/Daniel (developer of tcdirectmail)


More information about the TYPO3-english mailing list