add send mail logic