add mail function using the mail service provided by system
improve mail function