SACRAMENTO — Gov. Gray Davis signed into law Tuesday a groundbreaking bill aimed at banning often offensive "spam" advertisements from the online mailboxes of millions of California computer users.

The measure, by state Sen. Kevin Murray (D-Culver City), would make it illegal for spam marketers and their advertisers to e-mail Californians, unless the recipient had specifically requested it or had had a prior business relationship with the advertiser, such as a bookseller.

Violators would be subject to a fine of $1,000 for each unsolicited message and up to $1 million for blitz campaigns in which hundreds of thousands or even millions of unsolicited sales pitches are sent out daily.

As Davis signed the bill, SB 186, he announced that he had also signed or soon would approve other measures in a package aimed at protecting the privacy of Californians and guarding them from identity theft.

Many states, including California, have enacted laws aimed at cracking down on unsolicited e-mail, whose topics can include products such as sexual enhancers, "anti-aging" creams, weight-loss pills and heavily discounted home loans. But Murray said his bill, effective Jan. 1, would be the first to hold an advertiser liable along with the spam merchant.

"We think it is going to be the toughest bill in the nation," the senator said Tuesday. "The beauty of this is you go after the advertisers. They are fineable and attachable."

Murray noted that spam has increased astronomically in the last couple of years and said it costs frustrated businesses and consumers billions of dollars in wasted time as well as the costs of trying to prevent it.

The new law will allow state Atty. Gen. Bill Lockyer, Internet service providers and individual citizens to sue spam marketers and their advertisers in civil court. Backers of the bill said that feature alone would discourage spam.

As the bill traveled through the Legislature, lawmakers agreed that it would be relatively easy for California to win judgments against spam merchants and their advertisers in state courts. But some considered actually recovering damages from those outside the state and overseas problematic.

Currently, the state routinely sues out-of-state and foreign companies that do business in California for a variety of offenses, such as fraud and false advertising.

Lockyer spokesman Tom Dresslar said, for example, that a judgment could be made in favor of the state against a spam merchant in Beijing, but that it "may be more difficult, depending on distance and the circumstances, to collect. But that doesn't mean we don't go after the guy in Beijing."

Dresslar said Lockyer, who is currently prosecuting a spam merchant under another law, intends to aggressively enforce the anti-spamming law.

Murray disagreed that fines would be difficult to collect against spam merchants located beyond the California state line. He said that since virtually all online transactions involve the use of four internationally recognized credit card companies based in the U.S., it would be relatively easy to locate the offender's bank accounts and attach them for the amount of the fine owed.

Or, Murray said, the plaintiffs could sue a credit card company and attempt to attach the spam merchant's or advertiser's revenue that traveled through the company's channels.

"As long as we know where your money is, we can attach it," he said.

David Kramer, a partner in the Wilson Sonsini law firm in Palo Alto, has been dealing with efforts to control e-mail spam for seven years.

He said the only other state to pass a law banning spam is Delaware.

"It's not working there," said Kramer, "because banning spam is only half the battle. You actually have to create an effective enforcement mechanism to make sure the prohibition is enforced."

In Delaware, the principal enforcer is the attorney general, who is busy with more serious crimes.