A man sent his ex-partner a text threatening to take his own life and accusing her of being responsible for his death.
Daniel Todd posted a similar message on Facebook, saying goodbye to his friends.
The messages came a day after Todd, who suffers from mental health difficulties, was banned from contacting his ex as part of strict court bail conditions.
Kirklees magistrates heard that Todd faces trial accused of harassing his ex and on September 5 was given conditional bail not to contact her, go to her Bradley home or post images of her on social media.
But the following day he sent her a text, accusing her of lying to police and threatening to commit suicide.
The 46-year-old told his ex: “The pressure on me has become too much to take.
“Do not attend my funeral, do not shed a tear.
“I really hope you’re happy now, you murderer.
“If you care at all, give me a call before the tablets take effect.”
Magistrates were told that the victim dialled 999 because she was fearful for her ex’s safety but described feeling devastated and fearful about what he might do next.
Todd, of Roberttown Lane in Liversedge, also posted a similar message on Facebook, claiming that his heart was broken.
His solicitor explained that after he sent the messages he took a cocktail of prescribed medication and woke up in the high dependency unit at Huddersfield Royal Infirmary.
He added that the trigger for his behaviour was his court appearance.
But magistrates slammed his messages as “horrendous” and remanded him into custody until a video link hearing this Thursday.