----- Original Message -----
From: "Aidan" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Sunday, November 05, 2006 10:28 PM
Subject: [Zope] newbie -- creating a Product
I'm a complete Zope novice. Forgive me if my question is inane.
I need to be able to send an e-mail (following a form submit) with an
attachment
(and I prefer not to use DTML). I can send e-mails withOUT attachments,
but
according to this:
http://mail.zope.org/pipermail/zope/2005-May/159291.html
I need to create
"a simple product like this:
EmailTools/__init__.py
------------------- contents ---------------------------------
from AccessControl import allow_module, allow_class, allow_type
from AccessControl import ModuleSecurityInfo, ClassSecurityInfo
from email.MIMEText import MIMEText
from email.MIMEMultipart import MIMEMultipart
from email.MIMEBase import MIMEBase
from email.Header import Header
from MailCrypt import signmail
from email.Encoders import encode_base64
allow_class(BlockFormatter)
allow_class(MIMEBase)
allow_class(MIMEText)
allow_class(MIMEMultipart)
allow_class(Header)
allow_class(signmail)
allow_class(encode_base64)
---------------------------------------------------------------
"
This then will allow me to send attachments using
from Products.EmailTools import
MIMEText,MIMEBase,MIMEMultipart,Header,encode_base64
in the python script. (Without the EmailTools product Zope tells me I am
not
allowed to import MIME*)
This is where my question comes in. I have tried to create the product
both from
the ZMI (which does not allow the creation of __init__.py's) and via
command
line (in ~/Products, in lib/Python, everywhere that the sparse and
conflicting
information I have been able to gather tells me). Doing the latter I can
certainly create the __init__.py but the Product doesn't register with
zope.
Could someone give a quick walk-through (or point to an up-to-date source)
on
how to create this Product?
(I am running Zope 2.8.6-final, python 2.4.3, linux2)
For a single task like you have described it may be easier to create a
simple external method.
Jonathan
_______________________________________________
Zope maillist - [email protected]
http://mail.zope.org/mailman/listinfo/zope
** No cross posts or HTML encoding! **
(Related lists -
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )