A microoptoelectromechanical integrated spectrometer with a photonic element assembly having metal foil removably disposed on a first transparent substrate surface, the substrate having no foil on any other surface. A means is provided for directing source photons that are reflected from or transmitted through a sample, over a range of angles of incidence, into the transparent substrate and onto the metal foil such that source photons are incident at the Brewsters angle. A means is also provided for detecting an induced exponential field in the metal foil. A means is also provided for relating the induced exponential field to a known exponential field for the sample and determining the identity of the sample. The spectrometer performs ultraviolet-to-visible-to-infrared spectroscopy using photon tunneling and surface plasmon excitation.