adding mail function