modified sendmail.py