Added error message handling when log file or e-mail not accessible.