(yet again, please CC email@example.com in replies..)
Nicolas Georgakopoulos wrote:
I think I need it...
I don't ;-)
I have made a web page (ZPT) that a user answer's
to a questionnaire , most of the answers are provided by check boxes and
When the user submit the answers a mail is send with the answers by text
in a string format like coma separated values.
You have a python script to do this, right?
The problem is that my client request to get the answer by mail with a
file as an attachment so he can analyze the data with a statistical
Can this be done with Zope File Object ? (I don't think it can... )
You don't need a file object. Build the thing you want to send as a
string called data, and have a string variable called filename
containing the name you want to use for the attachment.
Then you need create a MIMEBase object for it:
# some imports
from email.MIMEBase import MIMEBase
from email import Encoders
# now create the attachment
msg = MIMEBase(maintype, subtype)
# now render the MailTemplate
wrapper = context.my_mail_template.as_message(
# insert params here
# finally, attach the file and send
You may also be interested in something I will likely add for the 1.1.0
Simplistix - Content Management, Zope & Python Consulting
Zope maillist - Zope@zope.org
** No cross posts or HTML encoding! **
(Related lists -