## Script (Python) "mail2admin" ##bind container=container ##bind context=context ##bind namespace= ##bind script=script ##bind subpath=traverse_subpath ##parameters=fullname=None,regno=None,email=None,probtype=None,descr=None,commt=None ##title= ## # $Id: mail2admin.py 2334 2007-10-09 15:01:36Z henrik $ mhost = context.MailHost prop = context.portal_properties d = {} d['fullname'] = fullname d['email'] = email d['email_from'] = prop.email_from_address d['regno'] = regno d['probtype'] = probtype d['descr'] = descr message = """ From: %(fullname)s <%(email)s> To: %(email_from)s Cc: %(email)s Bcc: waeup@saoas.org Reply-To: %(email)s Subject: Uniben Contact Fullname: %(fullname)s Member ID: %(regno)s Problem Type: %(probtype)s Description: %(descr)s """ REQUEST = context.REQUEST RESPONSE = REQUEST.RESPONSE redirect_url = REQUEST.HTTP_REFERER try: mhost.send(message % d) redirect_url = '%s/?%s' % (redirect_url,'portal_status_message=Your message has been sent!') except: redirect_url = '%s/?%s' % (redirect_url,'portal_status_message=An error occurred, your message has not been sent!') RESPONSE.redirect(redirect_url)