private function parseAttachments(array $files, string $message, string $contentType, string $hash) : string
    {
        $result = [];

        // The original message
        $result[] = '--body-mixed-' . $hash;
        $result[] = new Header('Content-Type', $contentType);
        $result[] = '';
        $result[] = $message;

        // The attachments
        foreach ($files as $file) {

            $headers = new Headers();
            $headers->add(new Header('Content-Transfer-Encoding', 'base64'));
            $headers->add(new Header('Content-Disposition', 'attachment'));
            $headers->add(new Header('Content-Type', 'application/octet-stream', [
                'filename' => $file->getFilename()
            ]));

            $result[] = '--body-mixed-' . $hash;
            $result[] = $headers;
            $result[] = '';
            $result[] = base64_encode($file->fread($file->getSize()));
        }

        return implode("\r\n", $result);
    }