Updated mail function.