The present invention discloses an atomizer for an electronic cigarette and an electronic cigarette. The atomizer comprises a substrate, a heating device and a cover member. The substrate is provided with a mounting space. One end of the heating device is inserted into the mounting space and partially extends to the outside through the substrate to form a controlling member, and the other end is exposed to the outer surface of the substrate. When the controlling member is pressed into the substrate by an external pressing force, the heating device is pushed to move toward the outside of the substrate along the mounting space and partially extends out of the substrate. The cover member is detachably mounted to the substrate and covers the controlling member. The technical solution of the present invention is convenient for the user to disassemble and replace the heating device inside the atomizer, thereby effectively saving the use cost.