public function appendAttachment($file)
    {
        if (!is_array($file)) {
            // treat the param as string (old format)
            $file = array(
                'file' => $file,
                'filename' => null,
                'charset' => null,
            );

            // is array, but not the right key
        } elseif (!isset($file['file'])) {
            // another (un-documented) old format: key is filename
            $keys = array_keys($file);
            $file = array(
                'file' => $file[$keys[0]],
                'filename' => is_numeric($keys[0]) ? null : $keys[0],
                'charset' => null,
            );
        }

        // push properly formatted file entry
        $this->_attachments[] = $file;
    }