Add mail func for server application