update for sendmail function