note 74608 deleted from function.mail by bjori
| From: | bjori@php.net | Date: | Fri, 20 Apr 2007 09:18:17 +0000 |
| Subject: | note 74608 deleted from function.mail by bjori | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-125599@lists.php.net to get a copy of this message | ||
Note Submitter: morty at gmx dot net
Reason: useless
----
After a some struggle I finally got some code that works quite well, even on really horrible
Servers:
<?php
function header_encode($in_str, $charset) {
$end = '?=';
$start = '=?' . $charset . '?B?';
for($i=0; $i < strlen($in_str); $i++){
if(!mb_check_encoding($in_str[$i], "ASCII")){
$code .= $in_str[$i];
} else {
if($code){
$out_str .= $start . base64_encode($code) . $end;
$code = '';
}
$out_str .= $in_str[$i];
}
}
return $out_str;
}
?>