作者 邓超

x

@@ -391,6 +391,13 @@ class Mail { @@ -391,6 +391,13 @@ class Mail {
391 if(!empty($body)){ 391 if(!empty($body)){
392 $description = ''; 392 $description = '';
393 foreach ($body as $key=>$item){ 393 foreach ($body as $key=>$item){
  394 +
  395 + if(!empty($item['body'])){
  396 + // 过滤二进制
  397 + $item['body'] = preg_replace('/<0x[a-f\d]+>/','',$item['body']);
  398 + $body[$key]['body'] = base64_encode($item['body']);
  399 + }
  400 +
394 if(!$description && in_array($item['type']??'',['text/html','text/plain'])){ 401 if(!$description && in_array($item['type']??'',['text/html','text/plain'])){
395 402
396 if(!empty($item['charset'])){ 403 if(!empty($item['charset'])){
@@ -411,9 +418,7 @@ class Mail { @@ -411,9 +418,7 @@ class Mail {
411 418
412 } 419 }
413 420
414 - if(!empty($body[$key]['body'])){  
415 - $body[$key]['body'] = base64_encode($body[$key]['body']);  
416 - } 421 +
417 422
418 if(!empty($body[$key]['filename'])){ 423 if(!empty($body[$key]['filename'])){
419 $body[$key]['filename'] = base64_encode($body[$key]['filename']); 424 $body[$key]['filename'] = base64_encode($body[$key]['filename']);