A nebulizer is proposed as depicted in exemplary FIG. 7 which comprises a replaceable container, a counting device and a lock for locking the nebulizer against further use. The container is provided with an electronic storage which is electrically connected to the counting device. The nebulizer comprises an electric drive for actuating the lock. This allows secure operation and/or simple handling of the nebulizer.