private function renderAttachments(&$content, $boundary)
    {
        foreach($this->attachments as $file => $name) {
            if (!is_readable($file)) {
                throw new MailException('File could not be read: ' . $file); // @codeCoverageIgnore
            }
            $data = chunk_split(base64_encode(file_get_contents($file)));
            $type = mime_content_type($file);
            $content .= "\r\n";
            $content .= "--$boundary\r\n";
            $content .= "Content-Type: $type;\r\n\tname=\"$name\"\r\n";
            $content .= "Content-Transfer-Encoding: base64\r\n";
            $content .= "Content-Description: \"$name\"\r\n";
            $content .= "Content-Disposition: attachment;\r\n\tfilename=\"$name\"\r\n";
            $content .= "\r\n";
            $content .= "$data";
        }
    }