Papaverine is an alkaloid found in opium. It takes its name from the genus name of the poppy family, papaverum. There are dozens of alkaloids found in opium, and papaverine usually makes up about 1% of them by weight.
Opiates, as a class, are the most important drugs in the world, both in terns of how necessary they are for the practice of medicine, and for their obvious, frequent, and persistent illegal use. This use reverberates beyond the world of chemistry and medicine: the United States is in the second decade of its war in Afghanistan, a war that is largely funded by, and fought over, the cultivation of opium poppies. This will not be the first war where opium was a contributing factor. But for all this interest, there is large parts of the basic chemistry and biology of opiates that aren't well understood.
Papaverine doesn't have a structure or effects that resembles morphine, which is often taken to be the classical model of what an opiate is, structurally and pharmacologically. Of course, some drugs that do have a structure close to morphine don't have its effects, and some drugs that have morphine's effects don't have its structure. Papaverine's main effect is to dilate blood vessels, which makes it useful for treating migraine, and also erectile dysfunction, although it is not a commonly used drug for either: I would imagine that most physicians have never even have heard of papaverine. Since it was discovered in 1909, it is also long past its patent date, and there are no companies marketing the use of papaverine.
The mechanism of papaverine's action is also unknown. I will quote directly from the National Institute of Health's description of the compound:
An alkaloid found in opium but not closely related to the other opium alkaloids in its structure or pharmacological actions. It is a direct-acting smooth muscle relaxant used in the treatment of impotence and as a vasodilator, especially for cerebral vasodilation. The mechanism of its pharmacological actions is not clear, but it apparently can inhibit phosphodiesterases and it may have direct actions on calcium channels.
It is also possible that some of the effects of natural opium are due to drugs like papaverine or substances like it: that through its vasodilating action, it works in synergy with other, more classical opiate compounds to relieve pain. But in any case, it is somewhat ironic that opium, which has produces a few chemicals that have caused so much attention and so much focus, for good and for ill, still has other chemicals in it that are quite unknown and poorly understood, even though they can be very useful.
The Merck Index