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