Catalyzes the N-methylation of nicotinamide and other pyridines to form pyridinium ions (By similarity). Involved in regulation of lifespan extension downstream of the sirtuin sir-2.1, probably through its role in nicotinic acid metabolism (PubMed:24077178). nicotinamide + S-adenosyl-L-methionine = 1-methylnicotinamide + S-adenosyl-L-homocysteine Suppressed lifespan extension when exposed to nicotinic acid and nicotinamide. Reduced reactive oxygen species levels when exposed to nicotinic acid. Belongs to the class I-like SAM-binding methyltransferase superfamily. NNMT/PNMT/TEMT family.