He was asked:
Two men disagreed about “intention.” One said, “Do not begin the prayer without an intention,” citing the Prophet’s words, may Allah bless him and grant him peace:
“Each person will have only what he intended.”
The other said, “It is valid without an intention.” Give us a ruling, and may you be rewarded.
He replied:
Praise be to Allah. Prayer is not valid without an intention. However, the intention resides in the heart, by the consensus of the Muslims. It consists of purpose and resolve. If someone intends in his heart something different from what he says with his tongue, what counts is what he intended in his heart.
The scholars differed over whether stating one’s intention is recommended, holding two views. They agreed that neither raising one’s voice when stating the intention nor repeatedly stating it is recommended; rather, the imams unanimously agree that these practices are prohibited. If someone does not state his intention verbally, his prayer is valid according to the four imams and others. Only a few outliers among the later scholars dissented.