added mailer.py and email function to base handler