added e-mail sending functionality