Changed the function views.send_mail to make it compatible with python 2.6