In the face of those pressures, at the fund-raiser on Wednesday — and at a second one at the home of the billionaire philanthropists Ann and Gordon Getty — the president sought to reassure his supporters that he would continue to fight for environmentally friendly policies.

“Despite a very aggressive agenda on the other side to block action, we’ve been able to double fuel-efficiency standards on cars,” Mr. Obama said at Mr. Steyer’s home. “We’ve been able to take mercury out of our air. We have been able to reduce carbon emissions in this country and have made not only this a healthier place to live, but have also begun to address in a serious way one of the biggest challenges of our time, and that is the challenge of climate change.”

Later, at the Getty home, the president said the political debate needs to “break out of this notion that somehow there’s a contradiction between us being good stewards of the environment and us growing this economy.”

“They are not a contradiction,” he said. “We can grow this economy fast and faster if we are seizing the opportunities of the future and not just looking at the energy sources of the past.”

Even as he spoke at the second fund-raiser, about 100 opponents of the pipeline protested outside, waving signs and chanting, “What do we want from our president? No pipeline for the 1 percent!” and “When I say pipeline you say kill! Pipeline! Kill!”

Inside, Mr. Obama told the donors that the best way to assure environmental action is to send more Democrats to Washington, returning the House to Democratic control and putting Representative Nancy Pelosi of California back in the speaker’s office.

“If we’re going to deal with climate change in a serious way, then we’ve got to have folks in Congress, even when it’s not politically convenient, to talk about it and advocate for it,” he said.

Earlier in the evening, the president said he was eager to work with Republicans who were willing to compromise. But he said he needed more Democrats to fully achieve an agenda his adversaries were trying to block.