added sending of emails