A U.K.-based email prankster tricked several White House officials into thinking he was other officials in emails, according to CNN.

The prankster used a technique that resembles spear-phishing in which hackers pretend to be someone else. Anthony Scaramucci, who was ousted as communications director Monday and Tom Bossert, Homeland Security adviser, fell for the prank.

On Saturday, the prankster emailed Scaramucci pretending to be Reince Priebus, who had announced a day earlier that he had resigned.

Get Breaking News Delivered to Your Inbox

"I had promised myself I would leave my hands mud free," wrote the fake Priebus, according to CNN, "but after reading your tweet today which stated how; 'soon we will learn who in the media who has class, and who hasn't', has pushed me to this. That tweet was breathtakingly hypocritical, even for you. At no stage have you acted in a way that's even remotely classy, yet you believe that's the standard by which everyone should behave towards you? General Kelly will do a fine job. I'll even admit he will do a better job than me. But the way in which that transition has come about has been diabolical. And hurtful. I don't expect a reply."

Scaramucci appeared to really think it was Priebus though. He said, "You know what you did. We all do. Even today. But rest assured we were prepared. A Man would apologize."

Homeland security and counterterrorism adviser Tom Bossert speaks about the malware known as WannaCry during a White House press briefing on May 15, 2017. Andrew Harnik/AP

In another exchange, the prankster pretended to be Ambassador to Russia-designate Jon Huntsman Jr. in which he asked whose head "should roll first." Scaramucci responded, "Both of them," which appeared to refer to Priebus and White House strategist Steve Bannon, the report said.

In an exchange with Bossert, the prankster pretended to be the president's son-in-law, Jared Kushner.

"Tom, we are arranging a bit of a soirée towards the end of August," the fake Kushner wrote to Bossert by email, the report said. "It would be great if you could make it, I promise food of at least comparible (sic) quality to that which we ate in Iraq. Should be a great evening."

Bossert wrote back, "Thanks, Jared. With a promise like that, I can't refuse. Also, if you ever need it, my personal email is (redacted)."

Eric Trump, the president's son, however, was not as easily fooled when the prankster pretended to be his brother Donald Trump Jr.

"I have sent this to law enforcement who will handle from here," Eric responded, CNN said.