TEXARKANA, Texas — A Texas woman who had minor acting roles in film and television was sentenced to 18 years in prison Wednesday for sending ricin-laced letters to President Barack Obama and former New York Mayor Michael Bloomberg.

A federal judge gave Shannon Guess Richardson, 36, the maximum sentence under her plea deal on a federal charge of possessing and producing a biological toxin.

She was also ordered to pay restitution. She had pleaded guilty to the charge in December.

“I never intended for anybody to be hurt,” she told the court, adding later, “I’m not a bad person, I don’t have it in me to hurt anyone.”

Richardson said she thought security measures would prevent the letters from ever being opened.

Prosecutors say Richardson mailed three letters from New Boston, outside Texarkana, then went to police and claimed that her estranged husband, Nathan Richardson, had done it.

She was arrested last June after authorities said she tried to implicate her husband, who had filed for divorce.

Richardson is escorted to a Titus County sheriff’s car after a court appearance in Texarkana, Texas.Photo: AP

Prosecutors say investigators noted inconsistencies in Richardson’s statements and later learned that she had purchased materials online to produce ricin, a toxin that can cause respiratory failure if inhaled.

Richardson has had minor roles in the television series “The Walking Dead” and the movie “The Blind Side.”

She also is the mother of six children — including one born prematurely while she was in custody.

She acknowledged in a signed plea agreement that she ordered castor beans online and learned how to process them into a substance used to make ricin.

Shannon Guess Richardson has appeared on TV shows such as “The Walking Dead.”Photo: Facebook

She obtained an email address, a PayPal shopping account and a post office box in her husband’s name without his knowledge, according to the document.

On the morning of May 20, 2013, she said, she waited for Nathan Richardson to go to work.

“After he left the house, I printed the mailing labels for President Barack Obama, New York City Mayor Michael Bloomberg, and Mark Glaze with The Raben Group,” Richardson said in the document.

At the time, Glaze was director of Mayors Against Illegal Guns, Bloomberg’s group advocating for tougher gun control.

The letter to Obama read, “What’s in this letter is nothing compared to what ive got in store for you mr president,” according to the document. “You will have to kill me and my family before you get my guns. Anyone wants to come to my house will get shot in the face.”

After mailing the letters, she admitted to trying to blame her husband and lying to authorities.