Provision proper handling of output logs and mailing
Implement mailing of errors