update function sendMail