A female physical education teacher broke down in tears when a judge sentenced her to more than two years in prison for having sex with two teenage boys in her care.

The 25-year-old woman from NSW, whose name has been suppressed, held her head in her hands while Perth judge Phillip Eaton recounted her indecent dealings with two boys, aged 15 and 16.

The woman faced nine charges relating to sexual acts that happened between December 2009 and January 2010.

She previously pleaded guilty to all charges.

The District Court heard the woman sent text messages to the boys, as well as nude and provocative pictures.

She invited them on separate occasions to her home, drank alcohol with them, and had sex with them in her bedroom.

Judge Eaton noted that the woman had a troubled past, including a history of alcohol and drug abuse.

She was in a violent relationship in NSW when she got the job as a physical education teacher at a high school in the Pilbara region.

Judge Eaton also noted that the woman was a popular teacher who had won awards for her teaching excellence.

Her defence lawyer had made the submission that the woman was upset about having to relocate to Newman and had begun drinking more as a result of the impending move, which led her to commit the crimes.

Judge Eaton described the woman's action as "self-destructive" and said it was "a pity" that her conviction meant she would never teach in an Australian school again.

The woman was sentenced to two years and four months in prison, but will be eligible for parole after serving 14 months.

AAP