We report the detection of two exoplanets and a further tentative candidate around the M-dwarf stars Gl96 and Gl617A, based on radial velocity measurements obtained with the SOPHIE spectrograph at the Observatoire de Haute-Provence. Both stars were observed in the context of the SOPHIE exoplanet consortiums dedicated M-dwarf subprogramme, which aims to detect exoplanets around nearby M-dwarf stars through a systematic survey. For Gl96, we present the discovery of a new exoplanet at 73.9 d with a minimum mass of 19.66 earth masses. Gl96 b has an eccentricity of 0.44, placing it among the most eccentric planets orbiting M stars. For Gl617A we independently confirm a recently reported exoplanet at 86.7 d with a minimum mass of 31.29 earth masses. Both Gl96 b and Gl617A b are potentially within the habitable zone, though Gl96 bs high eccentricity may take it too close to the star at periapsis.