add some code in sendEmail