php code added for writing away emails