作者 邓超

m

@@ -326,7 +326,8 @@ class Body { @@ -326,7 +326,8 @@ class Body {
326 public function getAttachment(bool $inline = false):array { 326 public function getAttachment(bool $inline = false):array {
327 $attachment = []; 327 $attachment = [];
328 foreach ($this->items as $item){ 328 foreach ($this->items as $item){
329 - if($item->eq('Content-Disposition',$inline ? 'inline' : 'attachment')){ 329 + // 有的邮箱服务器 不带inline,就只有通过content-id来识别了
  330 + if((!$inline && $item->eq('Content-Disposition','attachment')) || ($inline && $item->get('Content-ID'))){
330 $attachment[] = new Attachment($item); 331 $attachment[] = new Attachment($item);
331 } 332 }
332 } 333 }