Removing warnings from deprecated code.
Adding test to when email cant be sent.