napr. quoted printable:
(v debianu je treba mit nainstalovane php5-imap)
function encode_subject($subj) {
$in = array("\r\n", "\r", "\n", " ");
$out = array("", "", "", "_");
$subj = str_replace($in, $out, $subj);
return "=?UTF-8?Q?" . imap_8bit($subj) . "?=";
}
base64:
return "=?UTF-8?B?" . base64_encode($subj) . "?=";