A schoolteacher who plagued his former partner with text messages, emails and letters told her he would harm himself if she didn’t respond to him, magistrates have heard.

Penglais history teacher Simon Wallington, of 4 Y Gorlan, Llanilar, pleaded guilty to harassment of Sara Williams following their break-up, including sending Ms Williams two Valentine’s Day cards, and sending her an email shortly after being warned by police not to contact Ms Williams.

Prosecutor Rhian Jones said Wallington, 39, had been in a long-term relationship with Ms Williams, who worked at the same school as Wallington, but that after the couple split up Wallington sent a string of text messages, emails and letters to Ms Williams.

While many of the messages were friendly, Ms Jones said that some of them became abusive and saw Wallington insult Ms Williams.

There were also messages where he threatened to harm himself and at one point Wallington even told Ms Williams that he was in hospital after taking an overdose.

Ms Williams contacted police, but said she didn’t want to press charges and was happy for police to speak to Wallington about his behaviour, but shortly after he was warned, Wallington sent another email leading to Ms Williams speaking to police again.

Ms Jones said police had been prepared to caution Wallington, who has no previous convictions, but that shortly before he was due to be cautioned he contacted Ms Williams again.

In an interview Wallington said he had struggled with the break up and should have listened to the police officer.

Defence solicitor Katy Hanson said Wallington realised he had “reacted badly” and shouldn’t have continued to contact Ms Williams. She said Wallington has not contacted Ms Williams since April and had been seeking help from different agencies to address issues which Ms Hanson said was helping him.

She said he realises it was “extremely stupid” to continue to contact Ms Williams, who no longer works at the same school. Ms Hanson said Wallington would not oppose a restraining order that Ms Williams had asked for.

Wallington was fined £281 and will pay costs of £115.

He was made subject to a restraining order not to contact Ms Williams for five years.