Gavin Atkinson, 56, a biology teacher at Castlebrae Community High in Edinburgh faces two charges under the Communications Act for allegedly sending the messages.
It is understood both pupils named in the charges were under 16 at the time of the alleged incidents between last August and the end of June.
A police spokeswoman said: “A 56-year-old man has been charged with two offences under the Communications Act and assault, and a report has been sent to the procurator-fiscal.”
This is the latest in a long line of scandals to rock the school. Headteacher Derek Curran has already been suspended from his post and released on bail over multiple assault charges, including domestic abuse.
Mr Curran was moved from Forrester High in the capital last year on a one-year secondment as part of a bid to revive the under-performing Castlebrae.
Castlebrae was allowed to remain open last year, despite being less than one-third full, after parents campaigned to save it.
Council officials had recommended that the Craigmillar school – which had some of the worst exam results, truancy and exclusion rates in Scotland – should close.
But councillors decided to keep it open after a long-running campaign by parents, eventually drafting in Mr Curran as a “super head”. He had been headteacher since last June, when he was appointed to oversee the school and its feeder primaries.
Speaking to The Scotsman last year, he said changes were under way to address some of the concerns highlighted by the inspectors, including replacing about a quarter of the staff.
“When I was a maths teacher here in 1983, it was a thriving comprehensive school, where the bulk of the local community went,” he said. “The introduction of the parents’ charter [which gave parents more choice over which school to send their child to] totally destroyed that.”
Every pupil was given an iPad as part of a £770,000 package last year to revive the school’s fortunes and adverts were put on Edinburgh buses to promote the school.
However, following news of the charges against Mr Curran, Norma Prentice, the headteacher at Drummond Community High in Edinburgh, was appointed to lead Castlebrae through the 2014-15 session.
Evidence has since emerged that families are shunning the troubled secondary, with this session’s S1 roll of 27 down from a projected intake of 46 in March.