A coffee machine comprising water heating means, a pump for supplying water into the heating means and a dispensing unit for extracting the coffee with the heated water is described. The heating means comprise a tubular element inside which the water supplied by the pump flows, and a heating element, separated from the tubular element by an air cavity; the pump and the heating element are connected and regulated by an electronic board, so as to supply into the dispensing unit the heated water in at least two different modes and at a same preset temperature, the different modes corresponding to different types of coffee to be dispensed.