The present invention discloses an ingestible capsule containing drug and a method for controlled administration of the drug in a mammal for treatment of a disease of the GI tract. The capsule has electronic control means for dispensing the drug substantially to the diseased tissue sites of the GI tract, according to a pre-determined drug release profile obtained prior to administration from the specific mammal.