Mayor Bill de Blasio regularly used his City Hall staff to boost his 2017 re-election bid while state and federal authorities were investigating his campaign fundraising practices, according to internal emails released Thursday.

City rules prevent public employees from using their official time for political purposes. Yet over 205 pages of emails between the mayor and his two sets of staff, obtained through a Freedom of Information request and first reported by the Daily News, show that they routinely flouted those rules.

The most glaring example happened in December 2016, when the mayor asked his campaign and City Hall staff to coordinate a meeting with a deep-pocketed donor — and then tried to rope a deputy mayor into the fundraising effort.

“Steve Mostyn is in town from Dallas,” the mayor wrote to his City Hall scheduler and the deputy finance director for his campaign on Dec. 5, 2016.

“Very important I see him. Pls set up,” de Blasio wrote. His campaign finance director, Elana Leopold, followed up on her boss’s email.

“Mayor wants an hour w him and wants Herminia to stop by to say hi at the front of [sic] back end,” Leopold wrote, referring to Dr. Hermania Palacio, then the deputy mayor for health and human services.

De Blasio’s official scheduler, Prisca Salazar-Rodriguez, suggested having the meeting at City Hall before Leopold said, “I don’t think it’s allowed to be at City Hall.”

Members of Mostyn’s family later donated nearly $10,000 to the mayor’s re-election campaign.

Mayoral spokeswoman Freddi Goldstein said that “the mayor wanted Deputy Mayor Palacio to attend because they had a personal connection and he thought they’d enjoy meeting. She wasn’t able to attend, however, and the meeting did not occur at City Hall.”

“City Hall and the campaign followed all rules and regulations. There is nothing prohibiting the teams from coordinating on scheduling,” Goldstein said.

But Alex Camarda, with the good-government group Reinvent Albany, said the emails showed the mayor needs a state-versus-church divide to keep his political and official activities separate.

“The mayor’s campaign and City Hall should establish procedures that create clearer boundaries in setting up meetings and communications to separate campaign work from government work,” Camarda said.