The setting was an elegant in-town apartment, the guests an array of celebrities, feminists and longtime Democratic supporters: Singer Carly Simon, writer Gloria Steinem, former representatives Geraldine Ferraro and Bella Abzug, and Bianca Jagger, former wife of Mick.

Into this glitzy gathering strode the guest of honor, the pugnacious East Baltimore native now running for the U.S. Senate. For an hour Rep. Barbara A. Mikulski (D-Md.) wended her way through the elegant foyer, past the sushi and crab puffs, to make her standard pitch for the Equal Rights Amendment and other women's issues. Another hour later, she was gone -- her campaign treasury $15,000 richer for the effort.

A few days later, another crowd gathered at a swank downtown club to hear Republican Senate contender Linda Chavez denounce the ERA and "forced" busing. The guests, some corporate executives, some wearing dazzling jewels, listened appreciatively and then put their approval in writing -- on $7,000 worth of checks to the Chavez for Senate fund.

No matter what political message the candidate bears, these up-scale affairs are the standard stuff of an election year, with one exception. Mikulski's party was in New York and Chavez's was in Dallas, reflecting a growing reliance by Maryland candidates this year on raising money far from their home bases in Baltimore and Bethesda.

Slipping quietly off to Hollywood, Houston, New York and Los Angeles in recent months, some Maryland candidates have collected as much as half their total receipts to date from individuals out of state.

The practice began in earnest in Maryland in 1982, when Democratic Sen. Paul S. Sarbanes mounted a successful nationwide fund-raising drive to help stymie a media campaign launched against him by a national conservative group.

Now, four years later, candidates from the two parties agree that fund-raising among wealthy non-Marylanders has reached a new intensity. Among the reasons: an unusual number of candidates vying for open seats, a number of nationally known candidates who can tap into money networks across the country, and the increasing cost of running a campaign.

"What Barbara Mikulski and I are doing with most of our time -- and it's crazy -- is charging around Maryland and charging around the country" to raise money, Senate contender Rep. Michael D. Barnes (D-Md.) told members of a Democratic club recently. "We crossed paths last week in California. We were together in Florida a couple of weeks ago raising money. It's crazy the way candidates now spend the majority of their time."

The crowded field has meant that Maryland's traditional fund-raising sources, such as organized labor, are divided among several candidates rather than committed exclusively to one campaign. Labor, for example, contributed a large portion of the $450,000 that Sarbanes received in 1982 from political action committees. But this year labor support is divided between two of the leading Senate candidates, Mikulski and Barnes, and it is unclear whether either of them will become labor's primary beneficiary when substantial contributions are made later in the campaign.

"Everybody's running, everthing's changing," said longtime Sarbanes aide Peter Marudas, noting that the Democratic Senate primary alone pits two popular representatives, Mikulski and Barnes, and the governor, Harry Hughes, against each other. "The competition has forced people to go out of state."

So large has been the impact of out-of-state money that when Baltimore County Executive Donald P. Hutchinson took himself out of the Senate race this month, he cited as a key reason his inability to match Mikulski's fund-raising.

"I was very critical of Barbara in the way she raised money," Hutchinson said at his parting news conference. "I think it is unfortunate that it is necessary for a candidate for statewide office to go out of the state and outside the region to raise the necessary funds."

Like Hutchinson, who is barely known outside the Baltimore area, Republican congressional candidate Robert Neall has tried to exploit the fact that his likely opponent in the 4th District race in Anne Arundel County has raised substantial sums from individual contributors in other states. Neall, the minority leader in the House of Delegates, is hardly a household name. But in the general election he is expected to face Democrat Tom McMillen, a former Washington Bullets basketball player who has collected money from such far-flung spots as Beverly Hills and Palm Beach.

McMillen has received more than a third of the $269,000 he has raised so far from out-of-state individuals, including contributions from such luminaries as writer Herman Wouk, sportscaster Howard Cosell and, closer to home, Sen. John D. Rockefeller IV (D-W.Va.).

McMillen's ability to tap such celebrities prompted Neall to send out a retaliatory letter to Republicans in the district asking: "Are Tom McMillen's rich friends -- and powerful Washington lobbyists -- like the AFL-CIO -- trying to buy our congressional district for their own selfish interests?

"You be the judge!" it says.

McMillen's campaign manager, Jerry Grant, said that the donors are "social acquaintances" who have met McMillen during his travels with the Bullets.

Although Neall has had less access to individual donors in other states, he has raised nearly a third of his funds from conservative political action committees, some of them based outside Maryland. McMillen has about the same percentage of PAC contributions.

By and large, however, the most prominent candidates from the two parties defend the practice of courting outsiders as either a necessary phenomenon of this highly competitive political year or simply a fact of life of modern politics.

Campaigns are so expensive that "it is virtually impossible to raise that amount of money in-state," said Chavez, who collected almost 45 percent of her budget from out-of-state donors in the first three months of the year.

Chavez's media adviser, Doug Watts, said that airing a week's worth of radio commercials costs $19,000 in the Washington market and $14,000 in Baltimore. A week's worth of Washington television costs about $50,000; it is about $30,000 to $35,000 in Baltimore, he said.

"It's no great secret: Campaigns rely more and more on TV," said David Narsavage, communications director of the Republican Senatorial Campaign Committee. "How many hands you can shake at the factory gate is no longer the issue." That is especially true in widely publicized races such as the one for the seat of retiring GOP Sen. Charles McC. Mathias in Maryland. Even in areas such as Prince George's County and Baltimore, where strong local organizations have traditionally been the key to political victories, media advertising is becoming more important.

There also are fees for the battery of consultants and advisers that are standard features of a modern campaign. Several months ago, Hughes, an underdog in the Senate race against Barnes and Mikulski, paid $25,000 to his New York consultant and polling firm, Dresner & Sykes and Associates -- almost 20 percent of what he raised in a three-month reporting period.

To pay for these and assorted other campaign expenses -- bumper stickers, office space, telephones and direct mail included -- Maryland's U.S. House and Senate candidates likely will spend anywhere from $150,000 to $2 million each.

To attract that kind of money, especially in a crowded field, and believing that they need more of a draw than the usual watercress sandwiches, some Maryland candidates have made celebrities de rigueur at political affairs.

At a weekend of fund-raisers held for Mikulski in California last month, where one dinner raised $40,000, paying guests included singers Barbra Streisand and Ray Charles, actor Ted Danson of the television series "Cheers," Jo Beth Williams, who appeared in "The Big Chill," and television producer Norman Lear.

Sometimes, however, the guests are ordinary people such as Stanley Thomashow, a Brooklyn office supplies manufacturer who was one of the sponsors of Mikulski's star-studded New York reception.

"I love causes," said Thomashow, whose slightly rumpled, mismatched summer suit set him apart in the crowd that gathered in the stylish Manhattan apartment of longtime Democratic fund-raiser Elinor Guggenheimer. "And I don't take white cases -- white males that is. And I like people. Other than that, I support anybody who's reasonably left."

Mikulski has been among the most successful in attracting funds from around the nation, in part by capitalizing on her strong ties to the women's movement and the national Democratic Party. She raised $300,586 in the first quarter of 1986, of which at least 29 percent came from out-of-state individuals, according to a survey of campaign reports filed with the Federal Election Commission.

Airline tickets have become a regular expense of the Barnes campaign as well. The Montgomery County congressman has been feted by the governor of Puerto Rico as well as by a network of lawyer friends in New York, Boston and Washington. They have given Barnes about 27 percent of the $176,212 he collected in the first quarter.

Hughes, by comparison, collected 11 percent of his $132,000 from out-of-state donors in that period. Republicans also have aggressively wooed contributors around the country: 45 percent of Chavez's first-quarter funds came from non-Marylanders, as well as 17 percent of Senate candidate Richard Sullivan's.

The figures are based on an analysis of contributions of more than $200, whose donors must be listed by name and address. Some donors have been categorized as out of state because they listed business addresses in Washington. But they may live in Maryland.

Among individuals who gave $200 or more to Mikulski, 72 percent were from outside Maryland. In response to Hutchinson's criticisms, Mikulski said 60 percent of her contributors overall are Maryland residents, including constituents who give $5 or $10 at homier, in-state events such as "Bingo for Barb," "Bowling for Barb" and "Baby Boomers Boomlet for Barb."

"I've been able to raise money nationally, yes, but I'm being supported in California for the same reasons I'm supported in Maryland -- for being a strong advocate of women's rights, of day care," Mikulski said, "It just so happens that as a member of Congress you work on national issues . . . . I think Marylanders are proud of the fact that I'm seen as a national leader as well.

"I don't think it's evil," she said, "I don't think it's unfortunate."

For the first time, some lesser-known congressional candidates also are hitting the road for funds. In Montgomery County's crowded 8th Congressional District, raising money out of state, either in person or through direct mail, is fast becoming the latest fashion among the five Democrats and two Republicans battling in it, even though none of them is prominent outside the area.

The same is true of the Baltimore County-based 2nd Congressional District, where Democrat Kathleen Kennedy Townsend has collected half of her $150,000 treasury from family and friends out of town. New York fashion designer Oleg Cassini chipped in, as did her uncle, and Virginia resident, Sen. Edward M. Kennedy (D-Mass.).

Her opponent, Republican Rep. Helen Bentley, has not ignored that route either, though more substantial sums, half in the most recent reporting period, came from PACs. She has received checks from New York shipping executives and others who have followed her work with the maritime industry.

It is ironic that the benefit of raising money in other states was first discovered in Maryland by Sarbanes, a scholarly Baltimore Democrat and a critic of long, expensive campaigns. He was under attack by the National Conservative Political Action Committee, which targeted him as the U.S. senator most deserving of defeat in 1982 and poured $650,000 into the effort. But the attack backfired when Sarbanes was able to capitalize on the sympathy from liberal Democratic, labor and Greek American groups and individuals across the country.

Sarbanes aide Marudas said the network allowed Sarbanes to raise about 17 percent of his record $1.6 million from out-of-state individuals. Sarbanes' GOP opponent, former Prince George's County executive Lawrence J. Hogan, tried to follow suit though conservative Republican channels but was less successful.

Marudas said the strategy developed almost spontaneously, out of a network Sarbanes developed in his first campaign in 1976, largely of attorneys and Greek Americans "within which is a lot of our relatives, his and mine," said Marudas.

"It was pretty easy to say, 'Hey, Uncle Charlie, could you help us out?' "