Update function sendmail