reverted code to send email