A biodegradable electroactive material can be doped with a drug and the drug can be delivered to a living subject by stimulating the material with an electrical potential. The material (in this case a polymer) has an electrochemically responsive oligoaniline block terminated with a carboxylic acid moiety and is linked to an alcohol-terminated diol by an ester bond. Advantageously, the diol is PEG-400, PEG-2000, PCL-530, or PCL-2000.