Gravar-mail: Short-range spectroscopic ruler based on a single-molecule optical switch