Ionizing spectra of stars that lose their envelope through interaction with a binary companion: role of metallicity