SlightPHP\PHPMailer::AddEmbeddedImage PHP Method

AddEmbeddedImage() public method

Adds an embedded attachment. This can include images, sounds, and just about any other document. Make sure to set the $type to an image type. For JPEG images use "image/jpeg" and for GIF images use "image/gif".
public AddEmbeddedImage ( string $path, string $cid, string $name = '', string $encoding = 'base64', string $type = 'application/octet-stream' ) : boolean
$path string Path to the attachment.
$cid string Content ID of the attachment. Use this to identify the Id for accessing the image in an HTML form.
$name string Overrides the attachment name.
$encoding string File encoding (see $Encoding).
$type string File extension (MIME) type.
return boolean
    public function AddEmbeddedImage($path, $cid, $name = '', $encoding = 'base64', $type = 'application/octet-stream')
    {
        if (!@is_file($path)) {
            $this->SetError($this->Lang('file_access') . $path);
            return false;
        }
        $filename = basename($path);
        if ($name == '') {
            $name = $filename;
        }
        /* Append to $attachment array */
        $cur = count($this->attachment);
        $this->attachment[$cur][0] = $path;
        $this->attachment[$cur][1] = $filename;
        $this->attachment[$cur][2] = $name;
        $this->attachment[$cur][3] = $encoding;
        $this->attachment[$cur][4] = $type;
        $this->attachment[$cur][5] = false;
        $this->attachment[$cur][6] = 'inline';
        $this->attachment[$cur][7] = $cid;
        return true;
    }