The present invention refers to an electric device for evaporating and dispensing volatile substances, such as perfumes and insecticides, using thermal energy. The device comprises: a casing and a container of volatile substance detachably coupled with the casing, heating means arranged in the casing for heating the volatile substance, and control means for controlling the operation of the heating means in accordance with a heating program. The device further comprises detection means suitable for detecting an intrinsic characteristic of the container and/or the volatile substance, for example the color of a part of the container, the shape of a part of the container, the container material, or the volatile substance color. The control means are executes execute a specific heating program for a detected intrinsic characteristic, such as evaporation settings are set automatically for different types of volatile substances.