src/Mailer/Email.php
public function addEmbeddedBlobAttachment($content, $filename, $mimeType = null, $options = null, array $notUsed = []) {
		if ($mimeType === null) {
			$ext = pathinfo($filename, PATHINFO_EXTENSION);
			$mimeType = $this->_getMimeByExtension($ext);
		}

		$contentId = null;
		// Deprecated $contentId here
		if (!is_array($options)) {
			$contentId = $options;
			$options = $notUsed;
		}

		$filename = pathinfo($filename, PATHINFO_FILENAME) . '_' . md5($content) . '.' . pathinfo($filename, PATHINFO_EXTENSION);
		if ($contentId === null && ($cid = $this->_isEmbeddedBlobAttachment($content, $filename))) {
			return $cid;
		}

		$options['data'] = $content;
		$options['mimetype'] = $mimeType;
		$options['contentId'] = $contentId ? $contentId : str_replace('-', '', Text::uuid()) . '@' . $this->_domain;
		$file = [$filename => $options];
		$this->addAttachments($file);
		if ($contentId === null) {
			return $options['contentId'];
		}

		// Deprecated
		return $contentId;
	}
public function addEmbeddedBlobAttachment($content, $filename, $mimeType = null, $options = null, array $notUsed = []) {
		if ($mimeType === null) {
			$ext = pathinfo($filename, PATHINFO_EXTENSION);
			$mimeType = $this->_getMimeByExtension($ext);
		}

		$contentId = null;
		// Deprecated $contentId here
		if (!is_array($options)) {
			$contentId = $options;
			$options = $notUsed;
		}

		$filename = pathinfo($filename, PATHINFO_FILENAME) . '_' . md5($content) . '.' . pathinfo($filename, PATHINFO_EXTENSION);
		if ($contentId === null && ($cid = $this->_isEmbeddedBlobAttachment($content, $filename))) {
			return $cid;
		}

		$options['data'] = $content;
		$options['mimetype'] = $mimeType;
		$options['contentId'] = $contentId ? $contentId : str_replace('-', '', Text::uuid()) . '@' . $this->_domain;
		$file = [$filename => $options];
		$this->addAttachments($file);
		if ($contentId === null) {
			return $options['contentId'];
		}

		// Deprecated
		return $contentId;
	}
public function addEmbeddedBlobAttachment ( $ content , $ filename , $ mimeType = null , $ options = null , array $ notUsed = [ ] ) { if ( $ mimeType === null ) { $ ext = pathinfo ( $ filename , PATHINFO_EXTENSION ) ; $ mimeType = $ this -> _getMimeByExtension ( $ ext ) ; } $ contentId = null ; // Deprecated $contentId here if ( ! is_array ( $ options ) ) { $ contentId = $ options ; $ options = $ notUsed ; } $ filename = pathinfo ( $ filename , PATHINFO_FILENAME ) . '_' . md5 ( $ content ) . '.' . pathinfo ( $ filename , PATHINFO_EXTENSION ) ; if ( $ contentId === null && ( $ cid = $ this -> _isEmbeddedBlobAttachment ( $ content , $ filename ) ) ) { return $ cid ; } $ options [ 'data' ] = $ content ; $ options [ 'mimetype' ] = $ mimeType ; $ options [ 'contentId' ] = $ contentId ? $ contentId : str_replace ( '-' , '' , Text :: uuid ( ) ) . '@' . $ this -> _domain ; $ file = [ $ filename => $ options ] ; $ this -> addAttachments ( $ file ) ; if ( $ contentId === null ) { return $ options [ 'contentId' ] ; } // Deprecated return $ contentId ; }
Add an inline attachment as blob

Options:
- contentDisposition

@param string $content Blob data
@param string $filename to attach it
@param string|null $mimeType (leave it empty to get mimetype from $filename)
@param array|string|null $options Options - string CID is deprecated
@param array $notUsed
@return string|null CID CcontentId (null is deprecated)
Add an inline attachment as blob