We aim to determine the production rates of several parent and product volatiles and the 12C/13C isotopic carbon ratio in the long-period comet C/2004 Q2 (Machholz), which is likely to originate from the Oort Cloud. 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). We have obtained production rates of several volatiles (CH3OH, HCN, H13CN, HNC, H2CO, CO and CS) by comparing the observed and simulated line-integrated intensities. Furthermore, multiline observations of the CH3OH (7-6) series allow us to estimate the rotational temperature using the rotation diagram technique. We find that the 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/CH3OH/H2CO/CS/HNC/H13CN/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. 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 ~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 H13CN detection, the measured value of 97 pm 30 for the H12CN/H13CN isotopologue pair is consistent with a telluric value.