WordPress at a glance
function is not described

PHPMailer\PHPMailer

PHPMailer::addStringEmbeddedImage() public WP 1.0

Add an embedded stringified attachment. This can include images, sounds, and just about any other document type. If your filename doesn't contain an extension, be sure to set the $type to an appropriate MIME type.

{} It's a method of the class: PHPMailer{}

No Hooks.

Return

true|false. True on successfully adding an attachment

Usage

$PHPMailer = new PHPMailer();
$PHPMailer->addStringEmbeddedImage(;

Code of PHPMailer::addStringEmbeddedImage() WP 5.7.2

<?php
public function addStringEmbeddedImage(
    $string,
    $cid,
    $name = '',
    $encoding = self::ENCODING_BASE64,
    $type = '',
    $disposition = 'inline'
) {
    try {
        //If a MIME type is not specified, try to work it out from the name
        if ('' === $type && !empty($name)) {
            $type = static::filenameToType($name);
        }

        if (!$this->validateEncoding($encoding)) {
            throw new Exception($this->lang('encoding') . $encoding);
        }

        //Append to $attachment array
        $this->attachment[] = [
            0 => $string,
            1 => $name,
            2 => $name,
            3 => $encoding,
            4 => $type,
            5 => true, //isStringAttachment
            6 => $disposition,
            7 => $cid,
        ];
    } catch (Exception $exc) {
        $this->setError($exc->getMessage());
        $this->edebug($exc->getMessage());
        if ($this->exceptions) {
            throw $exc;
        }

        return false;
    }

    return true;
}