Can you please tell me how the drug amitriptyline causes constipation?

Bowel activity. Your bowel activity is regulated via autonomic tone, and neurotransmitter balance is part of this. Cholinergic impulses can make your bowel contract and move stool along. If anything disturbs these impulses, your bowel will become sluggish. Amitriptylene has strong anti-cholinergic properties -- so at a high enough dose, your bowel activity slows down. The result can be constipation.