mail function implemented