The first challenge: persuading Republican voters to trust mail voting.

“With Dave’s leadership, we ended up doing focus groups, and the three things that we thought that could get Republican voters to use mail-in ballots were, No. 1, Trump saying it’s OK,” Mr. Reilly said. “No. 2, convincing them that the military had been voting in this way forever. And No. 3, showing them that you can actually track your vote and it would count.”

Mr. Trump, for his part, sent mixed signals. In the early months of his candidacy, in 2023, he castigated mail voting and said he wanted “single-day voting,” a message many Republican voters took as a call to vote on Election Day.

But some of Mr. Trump’s allies began to encourage him to change his tune, at least somewhat.

“I worked hard to, you know, along with some other people, to get him to endorse it, and he did,” said Jim Worthington, a Republican donor and activist in Pennsylvania. “And that was key.”

By summer, Mr. Trump was encouraging voters to cast early ballots, including by mail, in a video message that was played at rallies and at the Republican National Convention in Milwaukee.

His different approach, however, was only part of the equation.

Republicans also needed to build a vote-by-mail operation essentially from scratch. Their effort in Pennsylvania began with a super PAC founded by Mr. McCormick well before he announced his candidacy for the Senate, and eventually grew to include numerous groups, including the Sentinel Action Fund, Keystone Renewal PAC and the Republican State Leadership Committee. They spent millions of dollars to turn out Republican mail voters, often focusing on low-frequency voters. The McCormick and Trump campaigns also pushed Republicans to vote early.