The co-chair of the Liberal Party's national campaign behaved "inappropriately" by emailing several pipeline stakeholders with advice on how to lobby a new government, and did the "responsible" thing by stepping down, Liberal Leader Justin Trudeau said.

Dan Gagnier resigned from his post with the Liberals on Wednesday, after an email came to light in which he advised the energy company TransCanada on who to target in a potential new government, in order to keep the Energy East pipeline project on track.

"We recognize that Mr. Gagnier's actions were inappropriate, and he took responsibility for them and stepped down from our campaign," Trudeau said Thursday, at a campaign event in Montreal. The Liberal leader stressed that Gagnier stepped down "within 24 hours" of the party learning about the email. "When we found out about it, we sat down with him and he chose to do the responsible thing," Trudeau said.

He also addressed a statement issued by the Liberal Party on Wednesday, in which the party said Gagnier has "always operated within full accordance of the rules."

Trudeau said Gagnier resigned on ethical grounds. "It's a way of demonstrating that we take ethical standards and responsibilities very seriously," Trudeau said. "We are going to demonstrate that we set a much higher bar."

He added that Gagnier will not be a part of his team "for the long-term future."

In a statement released Wednesday evening, Gagnier said he had relinquished his role to "avoid becoming a distraction."

"I have always conducted my business openly and in full accordance with the rules," he wrote.

In a statement to CTV Thursday, TransCanada spokesman James Millar said that Gagnier 鈥渉as worked鈥 with the company 鈥渙n the Energy East file since the spring of 2015, primarily offering us communications advice.鈥

鈥淲e thought it was important to get some factual insight into how we might best navigate the different political scenarios in Ottawa that could arise post-election,鈥 Millar said. 鈥淭hat factual insight was provided to us by Dan.鈥

鈥淚t is logical to assume that many companies and organizations would take similar steps in preparing for what the political landscape might look like after October 19th,鈥 Millar added.

鈥淲hatever the outcome and whatever party is in power TransCanada will work with the Prime Minister and his government in a respectful and positive manner,鈥 he said.

Both the NDP and the Conservatives attacked the Liberals over the Gagnier email.

On Thursday, NDP Leader Tom Mulcair attempted to link Trudeau to the sponsorship scandal that surrounded Jean Chretien and Paul Martin under the previous Liberal government.

"It's the same old gang, pulling the same old tricks," Mulcair said at a campaign event in Quebec. "Don't let them back in the door, just because they put on a new face." He also suggested the Liberals had already given up a "Liberal licence" for the Energy East pipeline, before getting "social licence" from the communities that will be affected.

Conservative Leader Stephen Harper also mentioned the sponsorship scandal in his response to the Gagnier resignation. "I think we should all understand the culture of the Liberal Party that gave us the sponsorship scandal has not changed, and it will not change," he said.

Trudeau said he was aware of the "challenges in perception" his party is faced with. "We will demonstrate a level of ethics and responsibility that Canadians deserve.鈥

Trudeau faced numerous reporter questions about Gagnier at his event in Montreal. At one point, a Liberal supporter from the crowd tried to heckle a reporter asking about Gagnier, which prompted Trudeau to intervene.

"Hey!" Trudeau said. "We have respect for journalists in this country. They ask tough questions, and they're supposed to."

Garrett MacSweeney, who teaches ethics at York University, the ethical problem appears to be at the end of the email, where Gagnier 鈥渟tarts to surmise the size of (the potential Trudeau) cabinet, as well as what might possibly on the agenda of a new government.鈥

鈥淗e鈥檚 almost tipping in some respects (about) conversations he鈥檚 had or that he may have been privy to,鈥 Gagnier added. 鈥淭hat鈥檚 where it draws out the perception of a conflict of interest.鈥

MacSweeney said Gagnier may not have broken lobbying laws, but, 鈥淚 strongly believe that there鈥檚 been a violation of the spirit of what we conceive of as lobbying.鈥

鈥淎lthough the Liberal party is claiming he wasn鈥檛 involved in conversations of energy policy, that is his forte,鈥 Gagnier added, 鈥溾o there鈥檚 a transparency question there as well.鈥