Tools\Mailer\Email::_attachInlineFiles PHP Method

_attachInlineFiles() protected method

CUSTOM FIX: blob data support
protected _attachInlineFiles ( string | null $boundary = null ) : array
$boundary string | null Boundary to use. If null, will default to $this->_boundary
return array An array of lines to add to the message
    protected function _attachInlineFiles($boundary = null)
    {
        if ($boundary === null) {
            $boundary = $this->_boundary;
        }
        $msg = [];
        foreach ($this->_attachments as $filename => $fileInfo) {
            if (empty($fileInfo['contentId'])) {
                continue;
            }
            if (!empty($fileInfo['data'])) {
                $data = $fileInfo['data'];
                $data = chunk_split(base64_encode($data));
            } elseif (!empty($fileInfo['file'])) {
                $data = $this->_readFile($fileInfo['file']);
            } else {
                continue;
            }
            $msg[] = '--' . $boundary;
            $msg[] = 'Content-Type: ' . $fileInfo['mimetype'];
            $msg[] = 'Content-Transfer-Encoding: base64';
            $msg[] = 'Content-ID: <' . $fileInfo['contentId'] . '>';
            $msg[] = 'Content-Disposition: inline; filename="' . $filename . '"';
            $msg[] = '';
            $msg[] = $data;
            $msg[] = '';
        }
        return $msg;
    }