A federal judge in San Francisco ordered a Los Angeles company Wednesday to stop sending unsolicited e-mails the Federal Trade Commission and California’s attorney general allege violate so-called anti-spamming regulations.

U.S. District Judge Samuel Conti, at the urging of the government, directed Optin Global Inc. and its owner and president to refrain from sending bulk e-mails advertising mortgages, pharmaceutical products and online college degrees. The government said the e-mails are illegal because the messages allegedly are not marked as advertisements, they don’t provide consumers with a method of getting off the distribution list and, among other things, they don’t identify the sender.