Catherine E. Reinehr wrote:
try:
mailhost=getattr(context, context.superValues('Mail Host')[0].id)
except:
raise AttributeError, "cant find a Mail Host object"
...passing comment, this is extremely bad code.
A bare try/except is bad.
Why catch the exception in the first place, just let it propogate.
try:
mailhost.send(printed, mTo, mFrom, mSubj)
request.RESPONSE.redirect('/sbps/application_success')
except:
request.RESPONSE.redirect('/sbps/application_error')
Another bare except, also insanely bad...
You could do with looking at either MailTemplates or, better still,
Twiddler with a plain text input parser and email output renderer.
cheers,
Chris
--
Simplistix - Content Management, Zope & Python Consulting
- http://www.simplistix.co.uk
_______________________________________________
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 )