note 75081 added to function.imap-8bit

From: Date: Fri, 11 May 2007 11:26:39 +0000
Subject: note 75081 added to function.imap-8bit
Groups: php.notes 
Request: Send a blank email to php-notes+get-126407@lists.php.net to get a copy of this message
Code based on k dot kozlowski at enter dot pl but for UTF-8 (the only problem i encounter is SUBJECT_ENCODED_TWICE on SPAM test with very long subject, but the same produce others MUA's) <? function header_quoted_printable_encode($string, $encoding='UTF-8') { $string = str_replace(" ", "_", trim($string)) ; // We need to delete "=\r\n" produced by imap_8bit() and replace '?' $string = str_replace("?", "=3F", str_replace("=\r\n", "", imap_8bit($string))) ; // Now we split by \r\n - i'm not sure about how many chars (header name counts or not?) $string = chunk_split($string, 73); // We also have to remove last unneeded \r\n : $string = substr($string, 0, strlen($string)-2); // replace newlines with encoding text "=?UTF ..." $string = str_replace("\r\n", "?=".HEAD_CRLF." =?".$encoding."?Q?", $string) ; return '=?'.$encoding.'?Q?'.$string.'?='; } ?> ---- Server IP: 69.147.83.197 Probable Submitter: 213.136.229.248 ---- Manual Page -- http://www.php.net/manual/en/function.imap-8bit.php Edit -- https://master.php.net/note/edit/75081 Del: integrated -- https://master.php.net/note/delete/75081/integrated Del: useless -- https://master.php.net/note/delete/75081/useless Del: bad code -- https://master.php.net/note/delete/75081/bad+code Del: spam -- https://master.php.net/note/delete/75081/spam Del: non-english -- https://master.php.net/note/delete/75081/non-english Del: in docs -- https://master.php.net/note/delete/75081/in+docs Del: other reasons-- https://master.php.net/note/delete/75081 Reject -- https://master.php.net/note/reject/75081 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#126407) next »