  The process $e^+e^-\to \pi^+\pi^-\pi^0\gamma$ is studied at a center-of-mass
energy near the $\Upsilon(4S)$ resonance using a data sample of 469 fb$^{-1}$
collected with the BABAR detector at the PEP-II collider. We have performed a
precise measurement of the $e^+e^-\to \pi^+\pi^-\pi^0$ cross section in the
center-of-mass energy range from 0.62 to 3.5 GeV. In the energy regions of the
$\omega$ and $\phi$ resonances, the cross section is measured with a systematic
uncertainty of 1.3\%. The leading-order hadronic contribution to the muon
magnetic anomaly calculated using the measured $e^+e^-\to \pi^+\pi^-\pi^0$
cross section from threshold to 2.0 GeV is $(45.86 \pm 0.14 \pm 0.58)\times
10^{-10}$. From the fit to the measured $3\pi$ mass spectrum we have determined
the resonance parameters $\Gamma(\omega\to e^+e^-){\cal B}(\omega\to
\pi^+\pi^-\pi^0)=(0.5698\pm0.0031\pm0.0082) \mbox{ keV}$, $\Gamma(\phi\to
e^+e^-){\cal B}(\phi\to \pi^+\pi^-\pi^0)=(0.1841\pm0.0021\pm0.0080) \mbox{
keV}$, and ${\cal B}(\rho\to 3\pi)=(0.88\pm 0.23\pm 0.30)\times 10^{-4}$. The
significance of the $\rho\to 3\pi$ signal is greater than $6\sigma$. For the
$J/\psi$ resonance we have measured the product ${\Gamma(J/\psi\to e^+e^-){\cal
B}(J/\psi\to 3\pi)}=(0.1248\pm0.0019\pm0.0026)\mbox{ keV}$.
