#40923 [Asn]: mb_send_mail does not encode subject correctly
ID: 40923
Updated by: moriyoshi@php.net
Reported By: quasar at aero dot ist dot utl dot pt
Status: Assigned
Bug Type: Feature/Change Request
Operating System: Linux
PHP Version: 5.2.1
Assigned To: moriyoshi
New Comment:
For the record, could you tell me the name of the e-mail client(s) your
end of people used at the time of the problem?
Previous Comments:
------------------------------------------------------------------------
[2007-03-27 00:44:59] quasar at aero dot ist dot utl dot pt
After further reading of RFC2047 (http://www.ietf.org/rfc/rfc2047.txt)
i have found this:
Ordinary ASCII text and 'encoded-word's may appear together in the same
header field. However, an 'encoded-word' that appears in a header field
defined as '*text' MUST be separated from any adjacent 'encoded-word' or
'text' by 'linear-white-space'.
This implies that the function's behavior is actually correct, however
it still creates problems with some e-mail clients.
I have filled this bug report following several bug reports on my end
of people having e-mail clients inserting encoding tags in the middle of
the subject.
For example (verified in pine): "hello [UTF-8]ãll".
Although it is now clear to me that the behaviour is in fact RFC2047
compliant, should it not be tweaked to make it more widely compatible
with a greater variety e-mail clients?
(Perhaps this should be moved to a feature request, and i am sorry for
the "false positive", i should have done my homework more carefully)
------------------------------------------------------------------------
[2007-03-26 19:18:26] tony2001@php.net
Could you please point me to an RFC which says the actual result is
incorrect?
------------------------------------------------------------------------
[2007-03-26 16:34:46] quasar at aero dot ist dot utl dot pt
Description:
------------
When trying to send an e-mail with international character in the
subject, mb_send_mail is expected to fully encode the subject string.
However it only encodes the string form the first word containing the
interantional characters on.
Reproduce code:
---------------
// Assuming $to, $message and $headers already defined
$subject = "hello ãll";
mb_send_mail($to, $subject, $message, $headers);
Expected result:
----------------
A fully encoded Subject header, in the form:
Subject: ?UTF-8?B?SOMETHING?=
Actual result:
--------------
Received e-mail relevant headers, as you can see the hello part of the
string, which has no international, characters is left unencoded:
Subject: hello =?UTF-8?B?w6NsbA==?=
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 8bit
Mime-Version: 1.0
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=40923&edit=1
Thread (7 messages)