add mail function and form validate