#23192 [Opn]: mb_encode_mimeheader mangles long lines?
| From: | jc at mega-bucks dot co dot jp | Date: | Mon, 14 Apr 2003 03:09:21 +0000 |
| Subject: | #23192 [Opn]: mb_encode_mimeheader mangles long lines? | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-37628@lists.php.net to get a copy of this message | ||
ID: 23192
User updated by: jc at mega-bucks dot co dot jp
Reported By: jc at mega-bucks dot co dot jp
Status: Open
Bug Type: mbstring related
Operating System: Red Hat Linux 8.0
PHP Version: 4.3.2RC1
New Comment:
Update: The subject is properly encoded *if* I truncate it to be:
$subject =
"【tokyo-avland】公的証明書の送";
This gives the following subject header:
Subject:
=?ISO-2022-JP?B?GyRCIVobKEJ0b2t5by1hdmxhbmQbJEIhWzh4RSo+WkxAPXEkTkF3GyhC?=
Previous Comments:
------------------------------------------------------------------------
[2003-04-13 21:59:01] jc at mega-bucks dot co dot jp
I am using mb_encode_mimeheader() and it seems that the function does
not work properly on long subject lines ...
$headers = "MIME-Version: 1.0\n" ;
$headers .= "From: $from <$from_email>\r\n";
$headers .= "Reply-To: $from <$from_email>\r\n";
$headers .= "Content-Type: text/plain;charset=ISO-2022-JP\n";
$body = mb_convert_encoding($body, "ISO-2022-JP","AUTO");
$subject =
"【tokyo-avland】公的証明書の送付期限のお知らせ";
/*
If I cut the subject to be
$subject =
"【tokyo-avland】公的証明書の送付";
There is no problem. Problems occur if I I put characters
after this ... This doens't work either:
$subject =
"【tokyo-avland】公的証明書の送付";
$subject .=
"期限のお知らせ";
*/
mb_language("ja");
$subject = mb_convert_encoding($subject, "ISO-2022-JP","AUTO");
$subject = mb_encode_mimeheader($subject);
mail($to, $subject, $body, $headers, $sendmail_params);
The mail I receive has the following subject line:
Subject:
=?ISO-2022-JP?B?GyRCIVobKEJ0b2t5by1hdmxhbmQbJEIhWzh4RSo+WkxAPXEkTkF3SVU0?=
=?ISO-2022-JP?B?fDhCJE4kKkNOJGkkOxsoQg==?=
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=23192&edit=1