A Texas actress who sent ricin-laced letters to President Barack Obama and the New York mayor then tried to blame the crime on her soon-to-be ex-husband was sentenced to 18 years in prison on Wednesday.

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. Richardson 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, who had minor acting roles in film and television, said she thought security measures would prevent anyone from opening the letters addressed to Obama and the now-former New York Mayor Michael Bloomberg.

Prosecutors say Richardson mailed three letters from New Boston, outside Texarkana, then went to police and claimed that her estranged husband had done it. She was arrested last June after authorities said she tried to implicate her husband, who had filed for divorce.

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.

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. 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 her husband 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," she 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.

Richardson performed 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.