Context : Aims : The aim of this work is the study of the planet-metallicity and the planet-stellar mass correlations for M dwarfs from the HARPS GTO M dwarf subsample . Methods : We use a new method that takes advantage of the HARPS high-resolution spectra to increase the precision of metallicity , using previous photometric calibrations of [ Fe/H ] and effective temperature as starting values . Results : In this work we use our new calibration ( rms = 0.08 dex ) to study the planet-metallicity relation of our sample . The well-known correlation for Giant planet FGKM hosts with metallicity is present . Regarding Neptunians and smaller hosts no correlation is found but there is a hint that an anti-correlation with [ Fe/H ] may exist . We combined our sample with the California Planet Survey late-K and M-type dwarf sample to increase our statistics but found no new trends . We fitted a power law to the frequency histogram of the Jovian hosts for our sample and for the combined sample , f _ { p } = C 10 ^ { \alpha [ Fe / H ] } , using two different approaches : a direct bin fitting and a bayesian fitting procedure . We obtained a value for C between 0.02 and 0.04 and for \alpha between 1.26 and 2.94 . Regarding stellar mass , an hypothetical correlation with planets was discovered , but was found to be the result of a detection bias . Conclusions :