add sendmail function