  We present the results of a detailed modeling aimed to reproduce the spectral
energy distribution (SED) of dust and molecular line emission of massive
protostars under the hypothesis that they form via an accretion process. We
model the emission originated in the infalling envelopes at scales smaller than
0.1 pc from the central protostar. To do that, we compared our model results
with observational data covering a wide range of wavelengths, paying special
attention to the high angular resolution mid-infrared data obtained with the
Gemini Observatory and the ammonia line emission observed with the VLA at
centimeter wavelengths. We have explored two kind of model envelopes. In the
first kind of models, spherical symmetry is assumed and the SED as well as the
ammonia emission of the infalling envelope are calculated. In this way, the
temperature, density, velocity, velocity dispersion, and ammonia abundance
variations along the core can be obtained. The second approach takes into
account deviations from the spherical symmetry, and parameters such as the
rotation, degree of elongation of the core, or inclination of the system can be
constrained through the SED fitting. Using these two approaches we have been
able to model the formation of massive stars with a degree of detail similar to
that reached for the low mass stars.
