got email.py working from database