Ex-EastEnders star Leslie Grantham, who played "Dirty" Den Watts, tried to kill himself three times after being pictured apparently exposing himself.
In the soap, "Dirty" Den was murdered by his girlfriend Chrissie
The actor felt he "let everyone down" and "life didn't seem worth living", he claims in his autobiography, which is serialised in the News of the World.
He was written out of the soap when the photographs, from a webcam feed in his dressing room, were published in 2004.
Den returned 14 years after a storyline which implied he was shot by a hitman.
In the book Grantham blames his sexual liaison on the boredom of life on the EastEnders set.
At the time he was forced to apologise to the cast and crew not just for his behaviour but also for allegedly insulting four of his co-stars.
"I tried to lie my way out of the situation instead of facing up to it like a man," he wrote, adding: "Things got so bad I tried to kill myself".
The 59-year-old said it was for the best that he was caught and he had now stopped going online.
Grantham returned in 2003, with the scandal happening the year after
"I deliberately don't access the internet any more. I have absolutely no desire to go on it at all.
"I don't have to lie about this any more. Now I'm just trying to get on with my life," he said.
Meanwhile the BBC has confirmed that actor Ray Brooks - who plays builder Joe Macer - will leave EastEnders next year.
His character is married to Pauline Fowler, who is to be written out of the soap when long-serving cast member Wendy Richard departs at Christmas.
"Ray will be leaving towards the end of January and it will be a dramatic storyline with lots of twists and turns along the way," a spokeswoman said.