Added mail function (test version)
Removed test function from mailing function