On May 4, prosecutors say 32-year-old Christopher J. Tatlock sent an email to Foxx threatening to shoot and hang her if she did not prosecute crime in Chicago.
After further investigation, authorities found evidence of a similar email sent to Mayor Lightfoot.
Investigators, including the Chicago Police Department, were able to trace the emails back to Tatlock.
Tatlock was charged with two counts of threatening a public official and two counts of a hate crime. He faces up to eight years in prison.
Tatlock's bond was set at $5,000.
"There is no room in our society for hate and violence, and we must condemn such actions in the strongest terms possible," Illinois Attorney General Kwame Raoul said in a statement.
Tatlock was put on electronic monitoring, and he had to surrender his FOID card and all guns in his possession, officials said. He was also ordered to not have any contact with the victims or their families, and he cannot use email in any circumstances.
"My office will work to hold accountable anyone who threatens the physical safety of any resident of our state – regardless of the position they hold," Raoul said.
Tatlock is due back in court on May 20 in Skokie.