DENVER — Thousands of City of Denver employees received an email with blistering criticism of Mayor Michael Hancock. The city’s legal team responded with a cease-and-desist order for the email’s author: former city auditor Dennis Gallagher.

Gallagher’s mass email accused the Mayor, who is running for re-election, of setting up a “Pay-to-Play” system to benefit elected officials and businesses. Gallagher’s email urged city employees to vote for one of Hancock’s challengers, Jamie Giellis.

Gallagher said Hancock has turned the city over to consultants whose “primary focus has been on furthering the interests of their corporate friends, not the employees of our city or the well being of the residents of Denver.”

Gallagher’s decades of public service include nearly 25 years in the State Legislature and terms as a Denver City Councilmember and City Auditor.

The email blast went to the work email accounts of more than 8,600 city workers over the weekend.

Denver’s Department of Law issued Gallagher a cease-and-desist letter ordering him not to email city workers again.

Cease-and-desist letters are typically used to put a party on notice that illegal behavior must stop or consequences will result. City officials acknowledge Gallagher did nothing illegal by contacting city workers.

The cease-and-desist letter said the Gallagher was putting city employees at risk of accidentally violating rules prohibiting political activity during work hours if they reviewed or forwarded the email while on the clock.

Read the letters from the city and from Gallagher here

The employees could read the email outside of work hours with repercussions under city rules.

“As a former Auditor, you will no doubt respect the inappropriate drain on City resources that this has caused,” wrote Robert Nespor, on behalf of Denver’s Department of Law.

A spokeswoman for Mayor Hancock said he did not direct his legal team to send the cease-and-desist letter.

The official social media accounts of city agencies and city employees have aggressively touted and defended Hancock in recent months as he faces a potentially challenging re-election, with several challengers.

Gallagher said he compiled the email list by combining a list of city employees, obtained through open records requests, and the city’s standard email address format.

Gallagher said Thursday he had not yet received the cease-and-desist letter but seemed amused at the city’s reaction.

“The pot needed a good stir,” Gallagher said.

WATCH: Our interviews with Denver mayoral candidates