sendmail function modified...