[Zope] Sendmail, Python and ZPT

beno zope@thewebsons.com
Mon, 04 Nov 2002 04:42:10 -0400


At 05:30 PM 11/3/2002 -0600, you wrote:
>On Sun, Nov 03, 2002 at 07:12:42PM -0400, beno wrote:
>
> > I'm sure you're right. However, I searched through half a year of
> > the archives for this and the ZPT list and found no references to
> > *sendmail* in the subject that also implied ZPT. Would you help me
> > anyway? Since this is important, I believe I'll write a How-To when
> > I'm done.
>
>I think the prevailing wisdom is that ZPT is best suited for XML-type
>content, and that DTML is still needed for non-XML dynamic content
>(email, javascript, etc.). You can still use ZPT as a front-end, but
>you'll need DTML or a Python script in the back to do the actual email
>composition.

Yes. It seems we lean toward the Python scripts since this can be 
integrated with ZPT.

>http://www.zopelabs.com/cookbook/991178206 for info on sending mail
>via Python script.

It threw an error. Here's the script:

try:
     mailhost=getattr(context, context.mailScript('MailHost')[0].id)
except:
     raise AttributeError, "cant find a Mail Host object"

I changed the name of the script to mailScript() from superValues(). I 
didn't pass any parameters. The original script had *Mail Host* as opposed 
to *MailHost* but I tried both. What am I missing?
TIA,
beno