A man who sent a threatening and highly offensive email to the Conservative MP Louise Mensch has been warned he will be jailed if he gets back in touch with her or other public figures he has targeted.

Frank Zimmerman was given a 26-week jail sentence, suspended for two years, after telling Mensch she faced a "Sophie's choice" and would have to pick which of her three children to save and which would die.

Zimmerman, 60, from Gloucester, was made the subject of a restraining order forbidding him from contacting Mensch and other well-known people including the businessman and reality television star Lord Sugar, military top brass and newspaper columnists.

The district judge Martin Brown told Zimmerman that the message to Mensch merited a custodial sentence but he had decided not to send him to prison immediately, partly because of his age and "problems" he suffered.

Brown told Zimmerman, who says he has agoraphobia, that he had committed a very serious crime and the comments "went beyond mere mischief". He added: "These were ugly, unpleasant and serious remarks to the complainant by email. They caused her great concern."

The judge said he had decided against banning Zimmerman from using a computer. "It had been my intention to prohibit him from using a computer and I accept the human rights angle and I accept the problems of policing that," he said.

Zimmerman targeted Mensch after last summer's riots when the Corby MP suggested that sites such as Twitter ought to be closed down if the police thought it necessary. Mensch was also in the public eye as a member of the Commons culture, media and sport committee, which questioned Rupert and James Murdoch over phone hacking.

Addressing her as the "slut of Twitter", Zimmerman said: "We are Anonymous and we do not like rude cunts like you and your nouveau riche husband Peter Mensch. We are inside your computer, all your phones everywhere and inside your homes.

"So get off Twitter. We see you are still on Twitter. We have sent a camera crew to photograph you and your kids and we will post it over the net including Twitter, cuntface. You now have Sophie's Choice: which kid is to go. One will. Count on it cunt. Have a nice day."

Mensch called in the police and arranged security for her family. In a victim impact statement, she said she had taken the threats seriously.

She said she knew the plot of Sophie's Choice, in which a Jewish mother in the second world war has to choose which of her children should die. "I am married to a Jewish man and I believe that the choice of this book and film was intentional," she said.

Zimmerman was charged with an offence of sending by public communication network an offensive, indecent, obscene, menacing message or matter. The case against him was proven in his absence after he failed to attend court, blaming his agoraphobia and depression.

Others whom he was banned from contacting included Lord Sugar, whom he had once messaged: "I've been trying to say this to you for some time, Sugar – you're fired", echoing Sugar's catchphrase in The Apprentice.

The restraining order also stipulated that Zimmerman should not contact General Sir Michael Jackson, the former head of the British army, or David Petraeus, the former US army commander and now director of the CIA.

Also on the list were people linked to Mensch, including her husband, Peter, and the writers and newspaper columnists Terence Blacker and Jennie Macfie.

Zimmerman maintains his innocence, claiming hackers must have sent the offensive message to Mensch. Kirsty Gordon-Cleaver, defending, said her client was considering an appeal.

She said: "He never will contact the people on the restraining order and it does not cause him any problems. He does, however, uphold his innocence in respect of this."