Philippe's office on Friday welcomed the resignation, describing it as a “responsible decision”.
Luc Lemonnier, a 50-year-old father of four who replaced Philippe as mayor of the Channel port city of Le Havre in 2017, announced his resignation on Thursday in order to “protect his family.”
He denied improper behaviour, saying “the exchange of messages occurred without any coercive intent and between consenting adults.”
Lemonnier had filed a libel suit last June over the publication of the text messages, though prosecutors later dropped the case.
“Municipal council members received a picture of the mayor along with a description of behaviours which he denies,” Lemonnier's lawyer Christian Saint-Palais told AFP.
But the woman who released the photos said she felt she had no other option.
“It was a very difficult situation,” she told a local radio station this week, on condition of anonymity.
“I've been married for more than 20 years, I have children and our relationship is fulfilling – I was not involved at all in any games of seduction,” she said.
The mayor's resignation is an embarrassment for the centrist Republic on the Move government which is hoping to win over Philippe's former political stronghold in the 2020 municipal elections.
Before signing on as prime minister to President Emmanuel Macron in 2017, Philippe served, both as mayor and as a member of parliament for Le Havre, as a member of the conservative party the Republicans.