Heroin and prescription opioid pain relievers both belong to the opioid class of drugs, and their euphoric effects are produced by their binding with mu opioid receptors in the brain. Different opioid drugs have different effects that are determined by the way they are taken and by the timing and duration of their activity at mu opioid receptors.