sendByEmail function created. can be tested from create event form