A sex attacker was locked up after taking a girl to a dark Mansfield alley, prompting her to text "help me, he is raping me".
Nottingham Crown Court heard the 18-year-old victim intended to send it to another girl who had gone with her to a Mansfield club - but a court heard she mistakenly posted it to her father.
Dawn Pritchard, prosecuting, said: "One can only imagine how her father felt when he saw that."
Benjamin Hoyland, aged 21, was locked up for 18 months after admitted the sexual assault on March 31 last year. He was put on the Sex Offenders' Register for a decade.
Miss Pritchard said that he had been with his girlfriend in the Lexis club on Clumber Street, Mansfield, but she had gone home.
When Hoyland saw his victim, he said she was "nice" and they kissed.
Miss Pritchard said: "The kissing was with consent. He said he wanted to go somewhere quiet and she said okay.
"They went through the main entrance and out. She asked where they were going and he said something like 'nowhere.' They went into an alleyway."
Hoyland exposed himself and managed to pull off some of her clothes. Miss Pritchard said she refused to carry out a sex act.
She said: "The victim said no. He didn't listen and she tried to prevent what he was trying to do. She then sent the text message.
"She then heard her name being shouted."
Matthew Smith, mitigating, said that Hoyland, formerly of Mornington Road, Holmewood, Chesterfield, used the words "disgusting and frightening" to describe the offence.
He had written a letter of apology saying: "I can only imagine how you and your family must have felt for the last 20 months. I am thoroughly sorry for my actions."
Mr Smith said the offence was "completely out of character" for Hoyland.
Mr Smith said: "He has let himself and his family down."
The shouts came from her friends who found her "shaking and crying". Hoyland ran off down West Gate.
Sentencing, Judge Sally Hancox told Hoyland: "What happened that evening, in perhaps the most simplistic of terms, was rough and deeply unpleasant.
"You committed a sexual offence against someone who was all but a stranger.
"The wider public must know that behaviour of this type cannot and will not be tolerated in a civilised society. She clearly said no but you persisted."
The judge ordered a "not guilty" verdict on a rape charge initially faced by Hoyland of St Peter's Avenue, Worksop.
The court heard that his victim still has nightmares. A medical examination found she had suffered abrasions in the attack.