Machine for inhibiting pathogenic agents during the preparation of beverages based on breast-milk substitutes and/or powdered products or the like, comprising: - a water line starting from a water tank and ending with at least one water outlet; - at least one tank for the powdered preparation, adapted to contain a powdered preparation or the like; said tank being refillable; - a compartment adapted to at least partially accommodate said at least one tank; - at least one hopper element comprising at least one first inlet adapted to receive the water coming out of said water tank and/or the powdered preparation delivered by said at least one tank for the powdered preparation and a delivery mouth for delivering the water and preparation mixed, wherein - said at least one tank for the powdered preparation can be removably inserted in said machine for preparing a beverage; and - said hopper element can be coupled with and decoupled from the machine; and - said hopper element comprising a closing element operated to slide between a working position, wherein it does not allow to deliver the water and preparation mixed from said hopper element, and an open position, wherein the delivery of the water and preparation mixed from said hopper element is allowed; characterized in that - said closing element being connected to a control unit configured to make said closing element switch from the working position to the opening position once the inner temperature of the liquid inside the hopper element has exceeded a first threshold value and has dropped back down below a second threshold value, said first threshold value being equal to 70°, said second threshold value being equal to 35°. - a water line starting from a water tank and ending with at least one water outlet; - at least one tank for the powdered preparation, adapted to contain a powdered preparation or the like; said tank being refillable; - a compartment adapted to at least partially accommodate said at least one tank; - at least one hopper element comprising at least one first inlet adapted to receive the water coming out of said water tank and/or the powdered preparation delivered by said at least one tank for the powdered preparation and a delivery mouth for delivering the water and preparation mixed, wherein - said at least one tank for the powdered preparation can be removably inserted in said machine for preparing a beverage; and - said hopper element can be coupled with and decoupled from the machine; and - said hopper element comprising a closing element operated to slide between a working position, wherein it does not allow to deliver the water and preparation mixed from said hopper element, and an open position, wherein the delivery of the water and preparation mixed from said hopper element is allowed; characterized in that - said closing element being connected to a control unit configured to make said closing element switch from the working position to the opening position once the inner temperature of the liquid inside the hopper element has exceeded a first threshold value and has dropped back down below a second threshold value, said first threshold value being equal to 70°, said second threshold value being equal to 35°.