Disclosed herein are substituted cinnamamide derivatives of formula I where the substituents are as defined herein. Also disclosed is a method for preparing the substituted cinnamamides of the present invention and salt derivatives thereof by using the substituted piperonal derivatives as raw materials via a Wittig reaction and an acid-amine condensation reaction. Further disclosed is the use of the compounds in the manufacture of a medicament for the treatment of mental diseases such as depression. Examples of the compounds of formula I include N-isobutyl-5&rsquo-nitro-3&rsquo,4&rsquo-methylenedioxy cinnamamide and 1-(5-trifluoromethyl-3,4-methylenedioxy benzoyl)-piperidine.