Pauline Hanson's challenge to the New South Wales election results has collapsed after her key witness admitted he faked the emails on which she built her case.

Ms Hanson launched her case after receiving an email from a man named Michael Rattner that alleged 1,200 of her upper house votes had been miscounted.

But now the email has been revealed as an elaborate hoax, with 35-year-old school teacher Sean Castle admitting in court he used a fake name to send the email. Mr Castle also admitted that nothing in the email was true.

Ms Hanson says she was originally alerted to the possible sabotage by someone who claimed to have learned of an email chain between Electoral Commission employees.

The emails allegedly discussed her votes, saying they had been put aside in a pile of blank ballots.

Mr Castle, a father of three, was granted protection from prosecution before being compelled to answer questions relating to the purported Electoral Commission email.

Under questioning, he said he had never received any email from the commission and that he had created it himself. He also admitted he has never known anyone who has worked for the Electoral Commission.

Ms Hanson says she is devastated.

"It's a terrible hoax. I think it was so vicious," she said.

Ms Hanson says the case has cost her tens of thousands of dollars in legal fees. It is unclear who will have to pay costs for the other parties in the case.

Her solicitor David Leamey says Mr Castle wasted many people's time and money.

"Certainly it's a huge public mischief that he's caused," he said.

Last week, a warrant was issued for a man identified as Michael Rattner after he failed to appear to give evidence in the case.

On Friday, Mr Castle appeared before the Supreme Court and apologised for having represented himself as Michael Rattner and for not showing up when required to.

Ms Hanson says she would like to see Mr Castle charged.

The case is continuing.

- ABC/AAP