Jim Ferguson, 62, who worked at the school for 28 years, has been reprimanded by the General Teaching Council for Scotland (GTCS) for the acts, which happened just four weeks after he retired amid a standing ovation from children and teachers.
He has now accepted a reprimand from GTCS, but the fact that has shown remorse for his acts has been taken into account and if he wished he could theoretically teach again.
The reprimand with consent order avoided the need for a full hearing in public and means no further details of the case will be released.
However GTCS has released Mr Ferguson’s declaration, in which he waives his right to a full hearing by admitting the allegation in full.
The declaration adds: “Between 15 January 2015 and 20 January 2015, both dates inclusive, you did send inappropriate electronic communications to a female pupil.
“I admit that the above means that my fitness to teach is impaired.
“I freely and willingly consent to a reprimand being imposed upon me in view of my admission of the allegation set out above.
“I understand that this reprimand will be recorded against my entry in GTC Scotland’s Register of teachers for an aggregated period of six months from the date of signing.”
The GTCS panel said: “A complaint has been received by the General Teaching Council for Scotland that alleges that the Registrant’s fitness to teach is impaired.
“The Investigating Panel further decided that in the circumstances it was appropriate to issue the Registrant with this Reprimand Consent Order.
“The Investigating Panel formed its view for the following more detailed reasons: No physical harm has been caused to a child or pupil, the registrant has demonstrated that he has reflected on the matter, and shown genuine remorse.
“There is no need to restrict or control the registrant’s ability to practice the teaching profession in view of the complaint.
“There is evidence attesting to the Registrant’s good character and history and a reprimand appropriately indicates to the profession and the public the seriousness of the complaint, therefore maintaining public confidence in teachers and the teaching profession.”
Footage, filmed by a pupil from the school, shows the moment hundreds of school children line the corridors of Queenferry High as Mr Ferguson leaves the building.
A massive round of applause is held throughout as the former deputy head walks down the middle of lined up children, pausing at point to take in the moment.
Mr Ferguson is then shown looking tearful as he holds his mouth before making his way to the schools entrance.
Just before leaving he raises both hands, waving to everyone before getting a hug from a woman, believed to be a member of staff.
Mr Ferguson, originally from Bellshill, Lanarkshire, got his first teaching job at Coatbridge High in North Lanarkshire.
After 18 months he become as assistant principal teacher of PE at Whitburn Academy, West Lothian and eight years later he became assistant principal teacher of enterprise education at the school.
In 1986 he was appointed head of PE at Queensferry High School before serving as deputy head from 2002 until he retired.
He married his wife Sandra, a primary teacher, in 1976 and the couple went on to have two children.
A City of Edinburgh Council spokesman confirmed the incident happened after Mr Ferguson had left the school and the pupil was attending Queensferry High chool.
He added: “The safety and welfare of our children is paramount and when concerns are raised we take immediate and appropriate action.”