modify sendmail code