Mount Albert Grammar School is investigating after an email containing porn was sent out to all 2700 of its students.
Headmaster Dale Burden said parents notified them yesterday, and the student email database was immediately closed down.
It appears a student set up a fake Gmail account and then somehow got into the school's email database, he said.
“Then they sent a link that had a pornographic image embedded in it to all of the students with an email address at school, so basically all of the students.
“Then they deactivated the fake account.”
Burden said an investigation was under way, the security of the database is being looked at and the hack would be treated as serious misconduct if a student was found to be behind it.
A version of this story was first published on radionz.co.nz