setting up mail function to handle deletion of accounts