...
|
...
|
@@ -317,18 +317,28 @@ class Mail { |
|
|
$body = $body[0]['RFC822.TEXT']??'';
|
|
|
|
|
|
if(!empty($body)){
|
|
|
$db->insert(bodySql::$table,[
|
|
|
'lists_id' => $id,
|
|
|
'text_html' => base64_encode(json_encode($body)) // todo::因为邮件会出现多编码问题,会导致数据库写不进去
|
|
|
],false);
|
|
|
|
|
|
$description = '';
|
|
|
foreach ($body as $item){
|
|
|
if(in_array($item['type'],['text/html','text/plain'])){
|
|
|
foreach ($body as $key=>$item){
|
|
|
if(!$description && in_array($item['type'],['text/html','text/plain'])){
|
|
|
$description = mb_substr(trim(strip_tags($item['body'])),0,190);
|
|
|
break;
|
|
|
}
|
|
|
if(!empty($body[$key]['body'])){
|
|
|
$body[$key]['body'] = base64_encode($body[$key]['body']);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
try {
|
|
|
$db->insert(bodySql::$table,[
|
|
|
'lists_id' => $id,
|
|
|
'text_html' => $body // todo::因为邮件会出现多编码问题,会导致数据库写不进去
|
|
|
],false);
|
|
|
}catch (\Throwable $e){
|
|
|
$db->update(bodySql::$table,[
|
|
|
'text_html' => $body // todo::因为邮件会出现多编码问题,会导致数据库写不进去
|
|
|
],dbWhere(['lists_id' => $id]),false);
|
|
|
}
|
|
|
|
|
|
|
|
|
// 更新描述
|
|
|
$db->update(listsSql::$table,[
|
|
|
'description' => $description
|
...
|
...
|
|