A bride-to-be reported her paedophile fiance to police five days before they were due to marry.
Richard Manley, 38, later admitted a total of 19 charges, including indecent assault, taking an indecent picture of a child, and distributing child pornography.
His former fiancee, a 35-year-old mother-of-two who had been in a relationship with him for four years, told the South Wales Echo: "Thank God I never married him. I was just days away.
"I had a lucky escape."
Manley, of System Street, Adamsdown, Cardiff, was given a six-year prison sentence at Cardiff Crown Court yesterday.
The court heard the offences came to light last September when Manley's partner confronted him after receiving a text message alleging he was a paedophile.
The woman, who did not want to be named, called police after Manley admitted taking an indecent photograph of a child in her underwear, and indecently touching her.
When police arrested him on 12 September, he told them: "I did take the picture, and sent it, years ago."
Manley later wrote a letter to his former partner, confessing to further offences he had committed.
Huw Evans, prosecuting, told the court Manley, an aircraft technician, became interested in child pornography in 2000 and shared photographs with others on the internet.
Robin Shellard, defending, said Manley resigned from his job in a letter to his employers after the offences came to light.
He said his client feels "real remorse", and added: "It is to his great credit that he has come forward before the world, and that has been a very difficult thing for him to do.
"The hardest thing was confessing all to his partner, the woman he loved and still loves deeply, and who perhaps will never forgive him.
"But he thought it was for the best that everything he did should come into the open, so he could try to get the help he needs."
In one of the letters, Manley wrote: "It was a time of life I regret, and I don't intend to repeat it."
Judge Stephen Hopkins QC told Manley he suffered from "perverted lust". He banned Manley from working with children for life, and ordered him to be placed on the sex offenders register.Reuse content