TALIWANG, Indonesia — The wildcat miner had something to prove: Processing gold ore with liquid mercury was perfectly safe. So he drank some of the toxic chemical, choosing the promises of gold fever over the pain of mercury poisoning.

“I have no worry about mercury,” bragged the fast-talking Syarafuddin Iskandar, 58. “I drank it. We gave it to the cows and the buffalos. They drank it. Nothing happened. There’s no problem.”

His stunt has made him famous in the gold fields of Sumbawa, an Indonesian island 100 miles east of Bali where makeshift mining camps dot the jungle hills. But it also illustrated the stark choice the illegal miners here face. In order to earn a living they effectively poison themselves, their communities and the environment by using mercury, an outlawed but popular way to extract gold from ore.

For decades, Mr. Syarafuddin and thousands of small-scale miners like him have worked illegally in West Sumbawa on land the government leases to large mining companies. The outlaw miners pay nothing for rights to the land but reap as much as $6 million a month in gold.