Catalyzes the conversion of caffeic acid to ferulic acid and of 5-hydroxyferulic acid to sinapic acid. The resulting products may subsequently be converted to the corresponding alcohols that are incorporated into lignins. (E)-caffeate + S-adenosyl-L-methionine = (E)-ferulate + H(+) + S-adenosyl-L-homocysteine Inhibited by Cu(2+), and to a lesser extent by Ni(2+), Mn(2+), Co(2+), Fe(3+) and Zn(2+). Unaffected by Fe(2+) and Mg(2+). Optimum pH is 7.0. Optimum temperature is 32 degrees Celsius. Aromatic compound metabolism; phenylpropanoid biosynthesis. Homodimer. Belongs to the class I-like SAM-binding methyltransferase superfamily. Cation-independent O-methyltransferase family. COMT subfamily.