The thermal structure of neutron star envelopes is discussed with emphasis on analytic results. Recent progress on the effect of chemical constitution and high magnetic fields on the opacities and the thermal structure is further reviewed in view of the application to pulsar cooling and magnetars.