A theory for the relaxation rates of a test electron and electron temperature in quantum wires due to deformation, piezoelectric acoustical and polar optical phonon scattering is presented. We represent intra- and inter-subband relaxation rates as an average of rate kernels weighted by electron wave functions across a wire. We exploit these expressions to calculate phonon emission power for electron intra- and inter-subband transitions in quantum wires formed by a parabolic confining potential. In a magnetic field free case we have calculated the emission power of acoustical (deformation and piezoelectric interaction) and polar optical phonons as a function of the electron initial energy for different values of the confining potential strength. In quantum wires exposed to the quantizing magnetic field normal to the wire axis, we have calculated the polar optical phonon emission power as a function of the electron initial energy and of the magnetic field.