The production of mesons in ultraperipheral collisions of relativistic heavy ions is reanalyzed using a projection technique to calculate the amplitudes for the appropriate Feynman diagrams. The virtuality of the exchanged photons is fully accounted for in this approach. In the case of two-photon fusion, it is explicitly shown that the inclusion of nuclear form factors validates the equivalent photon approximation. However, this does not apply to three-photon fusion cross sections. The cross section of J/ ψ production in ultraperipheral collisions at RHIC and LHC are shown to be much smaller than the cross sections for the production of C-even mesons of similar masses.