PHPMailer\PHPMailer\PHPMailer::addStringEmbeddedImage PHP Method

addStringEmbeddedImage() public method

This can include images, sounds, and just about any other document type. Be sure to set the $type to an image type for images: JPEG images use 'image/jpeg', GIF uses 'image/gif', PNG uses 'image/png'.
public addStringEmbeddedImage ( string $string, string $cid, string $name = '', string $encoding = 'base64', string $type = '', string $disposition = 'inline' ) : boolean
$string string The attachment binary data.
$cid string Content ID of the attachment; Use this to reference the content when using an embedded image in HTML.
$name string
$encoding string File encoding (see $Encoding).
$type string MIME type.
$disposition string Disposition to use
return boolean True on successfully adding an attachment
    public function addStringEmbeddedImage($string, $cid, $name = '', $encoding = 'base64', $type = '', $disposition = 'inline')
    {
        // If a MIME type is not specified, try to work it out from the name
        if ('' == $type and !empty($name)) {
            $type = static::filenameToType($name);
        }
        // Append to $attachment array
        $this->attachment[] = [0 => $string, 1 => $name, 2 => $name, 3 => $encoding, 4 => $type, 5 => true, 6 => $disposition, 7 => $cid];
        return true;
    }