Mail function (Front end not finished)