LOS ANGELES — Gwyneth Paltrow testified Monday in the trial of a man accused of stalking her, saying he sent her upsetting letters discussing his intention to marry her, her death, pornography and unsolicited gifts.

Dante Soiu is accused of stalking the Oscar-winning actress for 17 years, but the case focuses on the most recent batch of 66 messages he sent her between 2009 and 2015.

Paltrow was the first witness called and authenticated 48 of the letters, many of which contain religious messages and statements referencing Paltrow’s death.

She testified about letters and packages she received from Soiu dating to 1999, including several that contained pornography, sex toys and statements that he wanted to cleanse her of sin.

“This is a case that has gone on for Ms. Paltrow for 17 years,” Deputy District Attorney Wendy Segall said during opening statements. “Her sense of security has been shattered by this man.”

His lawyer said Soiu has simply written letters to Paltrow, and that recent letters haven’t included pornography.

Attorney Lynda Westlund said Soiu is a Christian man who is just trying to minister to the actress.

Soiu was found not guilty by reason of insanity in 2000 in a previous trial involving messages he sent to Paltrow, which included pornography and sex toys. He was sent to a mental institution for several years, but was re-arrested last year after sending the actress new correspondence.

Paltrow won an Oscar in 1999 for her role in “Shakespeare in Love.”

She has two children with estranged husband Chris Martin, the frontman of the band Coldplay.

The pair’s divorce, filed in April 2015, is still pending.