added mail function