src/Message/Helper/MultipartHelper.php
public function removeAllContentPartsByMimeType(Message $message, $mimeType, $keepOtherContent = false)
    {
        $alt = $message->getPart(0, PartFilter::fromInlineContentType('multipart/alternative'));
        if ($alt !== null) {
            return $this->removeAllContentPartsFromAlternative($message, $mimeType, $alt, $keepOtherContent);
        }
        $message->removeAllParts(PartFilter::fromInlineContentType($mimeType));
        return true;
    }
public function removeAllContentPartsByMimeType(Message $message, $mimeType, $keepOtherContent = false)
    {
        $alt = $message->getPart(0, PartFilter::fromInlineContentType('multipart/alternative'));
        if ($alt !== null) {
            return $this->removeAllContentPartsFromAlternative($message, $mimeType, $alt, $keepOtherContent);
        }
        $message->removeAllParts(PartFilter::fromInlineContentType($mimeType));
        return true;
    }
public function removeAllContentPartsByMimeType ( Message $ message , $ mimeType , $ keepOtherContent = false ) { $ alt = $ message -> getPart ( 0 , PartFilter :: fromInlineContentType ( 'multipart/alternative' ) ) ; if ( $ alt !== null ) { return $ this -> removeAllContentPartsFromAlternative ( $ message , $ mimeType , $ alt , $ keepOtherContent ) ; } $ message -> removeAllParts ( PartFilter :: fromInlineContentType ( $ mimeType ) ) ; return true ; }
Removes the content part of the message with the passed mime type.  If
there is a remaining content part and it is an alternative part of the
main message, the content part is moved to the message part.

If the content part is part of an alternative part beneath the message,
the alternative part is replaced by the remaining content part,
optionally keeping other parts if $keepOtherContent is set to true.

@param Message $message
@param string $mimeType
@param bool $keepOtherContent
@return boolean true on success
Removes the content part of the message with the passed mime type . If there is a remaining content part and it is an alternative part of the main message the content part is moved to the message part .