Gravar-mail: SPH with radiative transfer: method and applications