WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Самая быстрая Тема-конструктор для WordPress
функция не описана

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.

{} Это метод класса: PHPMailer{}

Хуков нет.

Возвращает

true/false. True on successfully adding an attachment

Использование

$PHPMailer = new PHPMailer();
$PHPMailer->addStringEmbeddedImage(;
$string(строка) (обязательный)
The attachment binary data
$cid(строка) (обязательный)
Content ID of the attachment; Use this to reference the content when using an embedded image in HTML
$name(строка) (обязательный)
A filename for the attachment. If this contains an extension, PHPMailer will attempt to set a MIME type for the attachment. For example 'file.jpg' would get an 'image/jpeg' MIME type.
$encoding(строка) (обязательный)
File encoding ($Encoding).
По умолчанию: 'base64'
$type(строка) (обязательный)
MIME type - will be used in preference to any automatically derived type
$disposition(строка) (обязательный)
Disposition to use

Код PHPMailer::addStringEmbeddedImage() WP 5.5.1

<?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;
}