In a letter to the Cabinet Secretary, Gus O'Donnell, Mr Brown said he was ready to take "whatever action is required" to prevent a repeat of the row.
He also calls for anyone caught "disseminating inappropriate material" to automatically lose their jobs.
The prime minister wrote: "I have already taken responsibility for acting on this - first by accepting Mr McBride's resignation and by making it clear to all concerned that such actions have no part to play in the public life of our country.
"I have also written personally to all those who were subject to these unsubstantiated claims."
Among Mr Brown's suggested revisions to the code is the proposal that special advisers should not be allowed to use official resources for party political purposes.
Mr McBride had used his Downing Street account when he sent the "inappropriate and juvenile" e-mails in January to former government spin doctor Derek Draper.
Mr Draper runs the LabourList blog and was proposing to set up Red Rag, a new gossip-led site. The idea was later abandoned.
However, they came to the attention of Paul Staines, author of the "anti-politics" Guido Fawkes blog, who revealed their existence. The row that followed forced Mr McBride's resignation on Saturday.
Waiting for letter
David Cameron was said to be "absolutely furious" about the claims made in the e-mails and shadow foreign secretary William Hague had called for an inquiry into the scandal.
Backbench Conservative MP Nadine Dorries, who was the focus of some of the e-mail correspondence, said she had not yet received a letter from the prime minister.
"I'm waiting to see the letter and waiting to see what it says. It is implied that there's going to be a clear apology," she told BBC News.
However, she said the current code of conduct already included safeguards to prevent such behaviour and avoid civil servants abusing the system for party-political means.
"I'm not sure what putting further precautions in place will achieve," she said.
"Everyone would like to see the existing code adhered rather than spinning new rhetoric about writing a new code."
Health Secretary Alan Johnson said Mr Brown could not be expected to apologise for something he had nothing to do with.
A number of Labour figures have spoken of their unease about the e-mails.
Tony Blair's former economic adviser, Derek Scott, told BBC Radio 4's Today programme that although he did not think Mr Brown was directly responsible, the smear tactics represented a culture that came from the top.
He said: "I think the tone, whether in a business or a political party, is set from above."
The BBC's John Pienaar said the affair was "seriously damaging for Labour, the government and Gordon Brown". Mr McBride had been seen as one of his closest advisers.
"Downing Street's early attempts to play down the scandal as 'something juvenile' or merely 'inappropriate behaviour' went down badly within the party, let alone the public.
"The stain of this affair won't be wiped away soon."
In his letter, Mr Brown insisted that no ministers had been involved in the e-mail conversation.
Cabinet Office minister Tom Watson denied at the weekend that he had been copied in on the e-mails and said the first he knew about them was when the story appeared on the news.
Mr Staines has refused to reveal how the messages found their way to him, despite complaints from Mr Draper that they were private.
Mr McBride had described the first claim as a ''solid investigative story'', but the other three as ''mainly gossipy, and intended to destabilise the Tories".
However, Mr Watson's Cabinet Office colleague Liam Byrne dismissed claims there had been plans for an orchestrated smear campaign.
Mr Draper has apologised to those mentioned in the e-mails and admitted "we should never really have considered the idea and I am sorry we did".
Although Mr Draper is not employed by the Labour Party, former deputy prime minister John Prescott has backed calls for the former spin doctor to be stripped of his post as a voluntary adviser on new media.
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.