Edit report at http://pear.php.net/bugs/bug.php?id=12216&edit=1

ID: 12216
Comment by: power_wong
Reported By: power at base23 dot com
Summary: Incorrect Mail_mime::headers() behaviour (russian
text, utf8)
Status: Closed
Type: Bug
Package: Mail_Mime
Operating System: linux
Package Version: 1.5.2
PHP Version: 5.2.4
Assigned To: cipri
New Comment:

The key setting should be the 'head_charset'. I quoted my working code
at below:

$mime = new Mail_mime;

$body = $mime->get($mimeparams);
$headers = $mime->headers($headers);
$page_content = "Mail now.";

$mail =& Mail::factory('mail');

Previous Comments:

[2010-03-03 07:31:22] roger

this bug is still remaining. I try to send letters with Russian text in
subject. Some of characters are not printable and displayed as ??. I
used this part of code:

and amount of non-printable characters was decreased, but still
ramaining. Without this code subject was:

with "head_encoding = base64" subject is


is it bug?
This is my mail script (body and subject contain Russian text. Body
displaying perfect!)

$text = '????????? ?????? ??????';
$html = '<html><body><h1>HTML ?????? ??????</h1><img
src="header-logo2.jpg" alt="Header Logo" /><p>?????? ?????????? ?
??????? ?????????? PEAR</p></body></html>';

$file = $abs_path.'/images/header-logo2.jpg';
$crlf = "\r\n";
$hdrs = array(
'From' => 'webmaster@vubor.org.ua',
'Subject' => '?????? ???????? ????? ('

$mime = new Mail_mime($crlf);
$get_param = array(
"text_encoding" => "base64",
"html_encoding" => "base64",
"head_charset" => "utf-8",
"text_charset" => "utf-8",
"html_charset" => "utf-8"

$mime->addHTMLImage($file, 'image/jpeg');
$body = $mime->get($get_param);
$hdrs = $mime->headers($hdrs);

$mail =& Mail::factory('mail');
$status = $mail->send('blomnik@gmail.com', $hdrs, $body);
if (PEAR::isError($status))
print("ERROR: Mail not sent!");


[2009-12-21 09:52:04] alec

<div id="changeset">
<span class="removed">-Status: Verified</span>
<span class="added">+Status: Closed</span>
</div>This bug has been fixed in SVN.

If this was a documentation problem, the fix will appear on pear.php.net
by the end of next Sunday (CET).

If this was a problem with the pear.php.net website, the change should
be live shortly.

Otherwise, the fix will appear in the package's next release.

Thank you for the report and for helping us make PEAR better.


[2009-08-25 08:05:41] cweiske

<div id="changeset">
<span class="removed">-Status: Feedback</span>
<span class="added">+Status: Verified</span>


[2008-11-11 09:10:45] warl0rd

The problem is the extras '=?ISO-8859-1?Q?' (or other enconding code)
and '=?' that appear several times in the subject line after performing:

$headers = $mime->headers($headers);

A quick fix is to overwrite the $headers['subject'] with just one
'=?ISO-8859-1?Q?' at the start and the '=?' in the end.



[2008-08-15 19:36:30] m0r1arty

$message=new Mail_mime();



The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 1 | next ›
Discussion Overview
grouppear-bugs @
postedOct 25, '11 at 7:19a
activeOct 25, '11 at 7:19a

1 user in discussion

Power_wong: 1 post



site design / logo © 2022 Grokbase