...
|
...
|
@@ -579,11 +579,16 @@ class Imap { |
|
|
preg_match('/\("charset" "([a-z0-9\-]{3,})"\)/iU',$result[$key]['BODYSTRUCTURE'],$charset);
|
|
|
// 编码
|
|
|
if(!empty($charset[1])){
|
|
|
// $encode = mb_detect_encoding($str, array("ASCII",'UTF-8',"GB2312","GBK",'BIG5'));
|
|
|
$result[$key]['HEADER.FIELDS']['Subject'] = mb_convert_encoding($result[$key]['HEADER.FIELDS']['Subject'], 'UTF-8', $charset[1]);
|
|
|
$result[$key]['HEADER.FIELDS']['From'] = mb_convert_encoding($result[$key]['HEADER.FIELDS']['From'], 'UTF-8', $charset[1]);
|
|
|
$result[$key]['HEADER.FIELDS']['To'] = mb_convert_encoding($result[$key]['HEADER.FIELDS']['To'], 'UTF-8', $charset[1]);
|
|
|
$charset = [$charset[1]];
|
|
|
}else{
|
|
|
$charset = [];
|
|
|
}
|
|
|
|
|
|
|
|
|
$result[$key]['HEADER.FIELDS']['Subject'] = MailFun::mb_coding($result[$key]['HEADER.FIELDS']['Subject'],$charset);
|
|
|
$result[$key]['HEADER.FIELDS']['From'] = MailFun::mb_coding($result[$key]['HEADER.FIELDS']['From'],$charset);
|
|
|
$result[$key]['HEADER.FIELDS']['To'] = MailFun::mb_coding($result[$key]['HEADER.FIELDS']['To'],$charset);
|
|
|
|
|
|
}
|
|
|
|
|
|
return $result;
|
...
|
...
|
|