Add email logging of errors and napoleonize the comments
Added documentation for email logging of warnings and errors