Mark Fynn had been jailed for 12 weeks in December last year after headbutting the victim while she was pregnant with their child and made the subject of a restraining order banning any contact with her for two years, Wolverhampton Crown Court heard.
The pair had been together since the April or May last year in a relationship that started off well but soon became violent, maintained Mr Nicholas Burn, prosecuting.
The victim described how Fynn, who had a 2016 conviction for battery against another girlfriend, had tried to strangle her before the head butting incident after which she reported him to the police.
The defendant sent her a stream of threatening text messages warning he would throw acid over her, "snap" her neck and "smash her head in," revealed Mr Burn.
Mr Philip Brunt, defending, disclosed there had been a partial rekindling of the relationship despite the restraining order but it ended when the victim walked out on him for good on August 25 this year.
Then Fynn sent more messages in which he admitted his behaviour had been "disgusting and unnecessary."
He vowed: "I don't hate you and am not going to be nasty anymore."
Mr Brunt said: "The communications were obvious breaches of the restraining order but there was nothing threatening in them this time. However he now accepts that the relationship is over."
Fynn from Wolverhampton Street, Dudley admitted harassment and breaching the restraining order.
He was jailed and given another order banning any contact with the victim for five years by Recorder Mark Brown who told him: "These were persistent breaches while you refused to accept this relationship was over."