Adds mail function to the lib