note 60002 added to function.imap-8bit
| From: | hans at lintoo dot dk | Date: | Thu, 22 Dec 2005 14:05:06 +0000 |
| Subject: | note 60002 added to function.imap-8bit | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-100573@lists.php.net to get a copy of this message | ||
The code below this note gives a lot of trouple with SpamAssasin, to fix it you will need to encode
your subject with something like this:
<?php
/**
* Function to encode a header if necessary
* according to RFC2047
*/
private function encodeHeader($input, $charset = 'ISO-8859-1')
{
preg_match_all('/(\s?\w*[\x80-\xFF]+\w*\s?)/', $input, $matches);
foreach ($matches[1] as $value) {
$replacement = preg_replace('/([\x20\x80-\xFF])/e', '"=" .
strtoupper(dechex(ord("\1")))', $value);
$input = str_replace($value, '=?' . $charset . '?Q?' . $replacement .
'?=', $input);
}
return wordwrap($input,75,"\n\t",true);
}
?>
----
Manual Page -- http://www.php.net/manual/en/function.imap-8bit.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+60002
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+60002&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+60002&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+60002&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+60002&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+60002&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+60002&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+60002&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+60002&report=yes
Search -- http://master.php.net/manage/user-notes.php