public function addAttachment($filePath) {
        if (!$file = fopen($filePath, 'r')) {
            throw new Exception('Cannot open file "' . $filePath . '"');
        }

        $this->attachments[$filePath] = chunk_split(base64_encode(fread($file, filesize($filePath))));
        return $this;
    }