configured mailSender with user and password, and fixed exceptin handling