SACRAMENTO, Calif. — California Assemblyman Jimmy Gomez sent more than 200,000 pieces of mail to constituents last winter. One letter invited women to self-defense classes, another highlighted a bird-watching event, and a third promoted a tree adoption day.

The mailings, all sent in a two-week period, cost $62,000, and taxpayers foot the bill, according to data obtained by The Associated Press through a public records request.

Last year, California Assembly members spent $3.2 million sending mail to their constituents, taking advantage of a legislative perk that allows them to use tax dollars to cover the costs. Senators spent $230,000 on postage costs in the same timeframe.

Lawmakers aren’t supposed to spend money on campaign mail. But Assembly spending data shows their spending on mail to constituents is typically higher during election years, and that those with the highest tabs are usually in the most competitive races.

In Gomez’s case, the letters went out as he was ramping up his campaign for an open U.S. House seat that attracted 23 candidates.

Paul Seamus Ryan, vice president of policy and litigation at Common Cause, said periodic mailings touting a lawmaker’s efforts or highlighting a local event benefit incumbents.

“When the spending is being done principally or disproportionately by legislators who are running for office, it certainly seems to be an abuse of taxpayer dollars,” said Ryan, whose Washington, D.C., organization advocates government transparency. “You don’t have to say ‘Vote for me’ in order to effectively encourage someone to vote for you.”

All 80 Assembly seats were on the ballot in 2016, while only 20 of 40 Senate seats were.

Such mail is prohibited within 60 days of an election, which helps explain why Gomez’s flurry — he sent more taxpayer-funded mail in two weeks than the entire previous year — ended two months before the primary election for the Los Angeles congressional seat Xavier Becerra vacated when he was appointed state attorney general.

Once Gomez was within two months of the election, his congressional campaign logged its first mailing expense, according to Federal Election Commission records.

Gomez, a Democrat, won that election and the June runoff to become California’s newest congressman.

Voters passed a law in 1988 prohibiting the use of public money for mass mailings to prevent lawmakers from spending tax dollars for political and campaign purposes. But the Fair Political Practices Commission, a California board that enforces campaign finance laws, has since written rules outlining exemptions that allow lawmakers to send non-campaign mail.

“It may not be a campaign piece, but it can be made to make the candidate or officeholder look as good as possible,” commission spokesman Jay Wierenga said.

Each chamber’s leadership establishes members’ operating budgets, which include money for mailings. There’s no cap on how much a lawmaker can spend on mailings.

In response to the AP’s records request, the Assembly provided a breakdown on the number, cost and content of mailings sent by the chamber’s top spenders.

During the first six months of this year, Assembly members spent more than $600,000 on mailings. Republican Catharine Baker was tops with more than $70,000, followed by Gomez, then Democrat Rudy Salas, who spent more than $50,000, according to the Assembly’s latest expenditures report.

Baker, whose office did not respond to a request for comment, represents a predominantly Democratic district in the San Francisco Bay Area. She sent mailings outlining her positions on innovation, California’s bullet train project and small businesses.

Salas, who represents a competitive Central Valley district, issued a statement saying the mailings are an “excellent tool that constituents have told me they appreciate.”

Bob Stern, a former Fair Political Practices Commission general counsel, said lawmakers should communicate with their constituents, and spending on mail in nonelection years generally doesn’t bother him. But he said the commission should impose greater restrictions during election years.

“It gives incumbents an unfair advantage,” he said, noting Gomez’s example is a “perfect case of where it shouldn’t be allowed.”

Gomez spokeswoman Bertha Guerrero defended the mailings but did not answer questions about whether he used them to further his campaign. “During his entire time in the California Assembly, Congressman Jimmy Gomez put a priority on being accessible, responsive and engaging with constituents,” she said in a statement.

Assembly members spent nearly $300,000 more in 2016 than in 2015, even though blackout periods for mail leading up to last year’s elections gave them less time to spend. The previous election cycle, they spent nearly $500,000 more.

In 2016, Assemblyman Marc Steinorth spent the most — nearly $270,000. He narrowly won re-election in a Southern California district where Democrats outnumber Republicans.

Former Assemblywoman Young Kim spent the second-highest amount — more than $220,000 — leading up to an election in Orange County where she was defeated by Sharon Quirk-Silva, a Democrat Kim unseated in 2014.

Baker was next, spending roughly $220,000, followed by David Hadley, who spent more than $195,000. Like Kim, Hadley was defeated by a Democratic challenger he had unseated the previous election: Al Muratsuchi.

Spokespeople for Steinorth and Kim did not comment on their spending.

Hadley said he consulted with GOP leaders and decided to spend on mailings, adding his seat was a priority for the party because it’s a swing district.

He said he often sent mail to invite constituents to town halls or to request feedback. When part of his district faced water-quality issues, he said he gleaned valuable information about the scope of the problem through a mailed survey.

“In general, people really appreciated having been contacted,” Hadley said.