function addAttachment($data, $filename = '', $contenttype = 'application/octet-stream', $cid = FALSE)
    {
        if (!$cid) {
            $cid = md5(uniqid(time()));
        }

        $info['data']        = $data;
        $info['filename']    = $filename;
        $info['contenttype'] = $contenttype;
        $info['cid']         = $cid;

        $this->requestAttachments[] = $info;

        return $cid;
    }
function addAttachment($data, $filename = '', $contenttype = 'application/octet-stream', $cid = FALSE)
    {
        if (!$cid) {
            $cid = md5(uniqid(time()));
        }

        $info['data']        = $data;
        $info['filename']    = $filename;
        $info['contenttype'] = $contenttype;
        $info['cid']         = $cid;

        $this->requestAttachments[] = $info;

        return $cid;
    }
function addAttachment ( $ data , $ filename = '' , $ contenttype = 'application/octet-stream' , $ cid = FALSE ) { if ( ! $ cid ) { $ cid = md5 ( uniqid ( time ( ) ) ) ; } $ info [ 'data' ] = $ data ; $ info [ 'filename' ] = $ filename ; $ info [ 'contenttype' ] = $ contenttype ; $ info [ 'cid' ] = $ cid ; $ this -> requestAttachments [ ] = $ info ; return $ cid ; }
adds a MIME attachment to the current request.

If the $data parameter contains an empty string, this method will read
the contents of the file named by the $filename parameter.

If the $cid parameter is false, this method will generate the cid.

@param string $data        The data of the attachment
@param string $filename    The filename of the attachment (default is empty string)
@param string $contenttype The MIME Content-Type of the attachment (default is application/octet-stream)
@param string $cid         The content-id (cid) of the attachment (default is false)

@return string The content-id (cid) of the attachment
@access public
adds a MIME attachment to the current request .