Changeset 5565


Ignore:
Timestamp:
8 Oct 2010, 11:01:38 (14 years ago)
Author:
Henrik Bettermann
Message:

Catch traceback (SMTPSenderRefused)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/skins/waeup_uniben/mail2admin.py

    r3709 r5565  
    3535"""
    3636
    37 mhost.send(message % d)
    38 
    3937REQUEST = context.REQUEST
    4038RESPONSE = REQUEST.RESPONSE
     39redirect_url = REQUEST.HTTP_REFERER
    4140
    42 redirect_url = REQUEST.HTTP_REFERER
    43 redirect_url = '%s/?%s' % (redirect_url,'portal_status_message=Your message has been sent!')
     41
     42try:
     43    mhost.send(message % d)
     44    redirect_url = '%s/?%s' % (redirect_url,'portal_status_message=Your message has been sent!')
     45except:
     46    redirect_url = '%s/?%s' % (redirect_url,'portal_status_message=An error occurred, your message has not been sent!')
     47
    4448RESPONSE.redirect(redirect_url)
Note: See TracChangeset for help on using the changeset viewer.