Added log file check + moved some functions to other files to keep it organized.
Added email.py + small change