作者 邓超

x

... ... @@ -493,3 +493,20 @@ function get_email_uuid($subject,$udate,$form,$to,$size){
}
/**
* 转码
* @param string $str
* @param string $to
* @param string|null $from
* @return string
* @author:dc
* @time 2024/8/29 10:51
*/
function mb_iconv($str, $to, $from = null) {
try {
return mb_convert_encoding($str, $to, $from);
}catch (Throwable $e){
return $str;
}
}
... ...
... ... @@ -504,7 +504,7 @@ class Mail {
if(!$description && in_array($item['type']??'',['text/html','text/plain'])){
if(!empty($item['charset'])){
$value = @iconv($item['charset'],'utf-8',$item['body']);
$value = mb_iconv($item['body']?:'','utf-8',$item['charset']?:null);
$value = $value ? $value : $item['body'];
}else{
$value = $item['body'];
... ...