public function getPartByContentId($contentId)
    {
        $sanitized = preg_replace('/^\s*<|>\s*$/', '', $contentId);
        $filter = $this->partFilterFactory->newFilterFromArray([
            'headers' => [
                PartFilter::FILTER_INCLUDE => [
                    'Content-ID' => $sanitized
                ]
            ]
        ]);
        return $this->getPart(0, $filter);
    }
public function getPartByContentId($contentId)
    {
        $sanitized = preg_replace('/^\s*<|>\s*$/', '', $contentId);
        $filter = $this->partFilterFactory->newFilterFromArray([
            'headers' => [
                PartFilter::FILTER_INCLUDE => [
                    'Content-ID' => $sanitized
                ]
            ]
        ]);
        return $this->getPart(0, $filter);
    }
public function getPartByContentId ( $ contentId ) { $ sanitized = preg_replace ( '/^\s*<|>\s*$/' , '' , $ contentId ) ; $ filter = $ this -> partFilterFactory -> newFilterFromArray ( [ 'headers' => [ PartFilter :: FILTER_INCLUDE => [ 'Content-ID' => $ sanitized ] ] ] ) ; return $ this -> getPart ( 0 , $ filter ) ; }
Convenience method to find a part by its Content-ID header.

@param string $contentId
@return MessagePart
Convenience method to find a part by its Content - ID header .