#!/usr/bin/env python # show python where the web modules are import sys; sys.path.append('../'); sys.path.append('../../../') # set your own email here email = 'james@example.com' # define our custom handler def mail(info, email, message, reply): import web, web.mail web.mail.send( msg=info, to=email, reply=reply, subject='Error in website', sendmail='usr/bin/sendmail', smtp='smtp.ntlworld.com', method='smtp',# could use method='sendmail' to send using sendmail. type='html', ) print web.header() print message # setup our handler import web.error web.error.handle( handler = mail, output = 'debug', email = email, message = """ An Error Occured

Error Caught

An HTML debug view of the error was sucessfully emailed to %s

"""%email, reply = 'Developer <%s>'%email ) # rasie a test exception and wait for the email to arrive raise Exception('This is a test exception')