note 80662 deleted from function.mail by danbrown
| From: | danbrown@php.net | Date: | Mon, 20 Jun 2011 15:05:49 +0000 |
| Subject: | note 80662 deleted from function.mail by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-180707@lists.php.net to get a copy of this message | ||
Note Submitter: jano ATSOMERANDOMTEXTjanogarcia es
----
This is a simple and quick (dirty?) fix for encoding long UTF-8 email subjects.
<?php
$subject= mb_encode_mimeheader($subject,"UTF-8", "B", "\n");
?>
Changing the $transfer_encoding parameter* from B (Base64) to Q (Quoted-Printable) seems to work
too.
*See the mb_encode_mimeheader documentation here http://php.net/manual/en/function.mb-encode-mimeheader.php
This one is based on the previously posted solution by J.Halmu http://php.net/manual/en/function.mail.php#75886
, added the two last parameters to prevent long subjects from breaking the email. It worked
flawlessly on a RHEL environmet. No further tests, sorry.