Added logic for send email