  Recent observational studies of high- and low-mass YSOs at (sub)millimeter
and infrared wavelengths are reviewed, and chemical diagnostics of the
different physical components are summarized. Methods for determining the
temperature, density and abundance profiles in the envelopes are outlined, and
are illustrated for one high-mass and one low-mass YSO. The combination of
(sub)millimeter and infrared data gives a nearly complete chemical inventory of
the gas and solid state material. In both high- and low-mass YSOs, the chemical
characteristics are dominated by freeze-out in the cold outer part of the
envelope and evaporation of ices in the warm inner part. Abundance jumps of
factors of ~100 in selected molecules are found in the warm gas for both types
of objects. Potential differences include (i) the complex hot core chemistry,
which has been observed so far only for high-mass YSOs; (ii) the high level of
deuterium fractionation seen only in low-mass YSOs; (iii) the effects of
internal or external UV and X-rays; (iv) the relative importance of shocks
versus thermal heating of the envelope; and (v) the importance of geometrical
effects.
