@@ -436,7 +436,7 @@ private function fetchPart(Part $part) {
436
436
437
437
if ($ part ->type == IMAP ::MESSAGE_TYPE_TEXT && ($ part ->ifdisposition == 0 || (empty ($ part ->disposition ) || !in_array (strtolower ($ part ->disposition ), ['attachment ' , 'inline ' ])) ) ) {
438
438
439
- if (strtolower ($ part ->subtype ) == "plain " || strtolower ( $ part ->subtype ) == " csv " ) {
439
+ if ( in_array (( $ subtype = strtolower ($ part ->subtype )), [ "plain " , " csv " , " html " ]) && $ part ->filename == null && $ part -> name == null ) {
440
440
$ encoding = $ this ->getEncoding ($ part );
441
441
442
442
$ content = $ this ->decodeString ($ part ->content , $ part ->encoding );
@@ -456,20 +456,8 @@ private function fetchPart(Part $part) {
456
456
$ content = $ this ->convertEncoding ($ content , $ encoding );
457
457
}
458
458
459
- $ this ->bodies ['text ' ] = $ content ;
460
-
461
- $ this ->fetchAttachment ($ part );
462
-
463
- } elseif (strtolower ($ part ->subtype ) == "html " ) {
464
- $ encoding = $ this ->getEncoding ($ part );
465
-
466
- $ content = $ this ->decodeString ($ part ->content , $ part ->encoding );
467
- if ($ encoding != 'us-ascii ' ) {
468
- $ content = $ this ->convertEncoding ($ content , $ encoding );
469
- }
470
-
471
- $ this ->bodies ['html ' ] = $ content ;
472
- } elseif ($ part ->ifdisposition == 1 && strtolower ($ part ->disposition ) == 'attachment ' ) {
459
+ $ this ->bodies [$ subtype == "plain " ? "text " : $ subtype ] = $ content ;
460
+ } else {
473
461
$ this ->fetchAttachment ($ part );
474
462
}
475
463
} else {
0 commit comments