Added email functionality and scheduled tasks.