4 Jun
2003
4 Jun
'03
11:40 p.m.
I want to attach zope file objects (CMF Portal File) to a multipart email like this: for fileId in attachments: file = getattr(self, fileId) part = writer.nextpart() #part.addheader('Content-Transfer-Encoding', 'none') part.addheader('Content-Transfer-Encoding', 'base64') body = part.startbody ( file.getContentType() + '; name=' + file.id() ) #body.write(str(file)) base64.encode (file, body) This works fine with no encoding and text data, but binary data needs encoding. encode64 will not encode as the zope file has no read() method. Should i write my own wrapper class, or is there a simpler way?? TIA