Adding error handling. Starting setting up email server.