作者 邓超

1

... ... @@ -646,10 +646,10 @@ class Imap {
public function fetchBody($data,$saveFilePath=__DIR__,$is_uid = false){
// 取得body
$result = $this->fetch($data,'body',$is_uid);
foreach ($result as &$item){
foreach ($result as $key=>$item){
if (!empty($item['RFC822.TEXT'])){
// 解析
$item['RFC822.TEXT'] = (new Body($item['RFC822.TEXT'],$saveFilePath))->getItem();
$result[$key]['RFC822.TEXT'] = (new Body($item['RFC822.TEXT'],$saveFilePath))->getItem();
}
}
... ...
... ... @@ -319,13 +319,13 @@ class Mail {
if(!empty($body)){
$db->insert(bodySql::$table,[
'lists_id' => $id,
'text_html' => $body
'text_html' => base64_encode(json_encode($body)) // todo::因为邮件会出现多编码问题,会导致数据库写不进去
],false);
$description = '';
foreach ($body as $item){
if(in_array($item['type'],['text/html','text/plain'])){
$description = mb_substr(strip_tags($item['body']),0,190);
$description = mb_substr(trim(strip_tags($item['body'])),0,190);
break;
}
}
... ...