Removed unused code. Add sending mails.