Added e-mail sending. TODO: write tests...