Context : Submillimeter spectroscopic observations of comets provide an important tool for understanding their chemical composition and enable a taxonomic classification . Aims : We aim to determine the production rates of several parent- and product volatiles and the \ce ^12C/ \ce ^13C isotopic carbon ratio in the long-period comet C/2004 Q2 ( Machholz ) , which is likely to originate from the Oort Cloud . Methods : The line emission from several molecules in the coma was measured with high signal-to-noise ratio in January 2005 at heliocentric distance of 1.2 AU by means of high-resolution spectroscopic observations using the Submillimeter Telescope ( SMT ) at the Arizona Radio Observatory ( ARO ) . Results : We have obtained production rates of several volatiles ( \ce CH3OH , HCN , \ce H^13CN , HNC , \ce H2CO , CO , and CS ) by comparing the observed and simulated line-integrated intensities . We calculated the synthetic profiles using a radiative transfer code that includes collisions between neutrals and electrons , and the effects of radiative pumping of the fundamental vibrational levels by solar infrared radiation . Furthermore , multiline observations of the \ce CH3OH J = 7–6 series allow us to estimate the rotational temperature using the rotation diagram technique . We find that the \ce CH3OH population distribution of the levels sampled by these lines can be described by a rotational temperature of 40 \pm 3 K. Derived mixing ratios relative to hydrogen cyanide are CO/ \ce CH3OH/ \ce H2CO/CS/HNC/ \ce H^13CN/HCN = 30.9/24.6/4.8/0.57/0.031/0.013/1 assuming a pointing offset of 8″ due to the uncertain ephemeris at the time of the observations and the telescope pointing error . Conclusions : The measured relative molecular abundances in C/2004 Q2 ( Machholz ) are between low- to typical values of those obtained in Oort Cloud comets , suggesting that it has visited the inner solar system previously and undergone thermal processing . The HNC/HCN abundance ratio of \sim 3.1 % is comparable to that found in other comets , accounting for the dependence on the heliocentric distance , and could possibly be explained by ion-molecule chemical processes in the low-temperature atmosphere . From a tentative \ce H^13CN detection , the measured value of 97 \pm 30 for the \ce H^12CN/ \ce H^13CN isotopologue pair is consistent with a telluric value . The outgassing variability observed in the HCN production rates over a period of two hours is consistent with the rotation of the nucleus derived using different observational techniques .