All perfect praise be to Allah, The Lord of the Worlds, and may His peace and blessings be upon our Prophet Muhammad and upon all of his family and companions.
Jurists are of the view that person's intention lies in the heart and uttering it at the performance of devotional acts isn't conditioned while Hanafiee's preponderant opinion in addition to Shafiees and Hanbaliee's adopted one stated: "The utterance of one's intention is an act of Sunnah for the reason that the one in the heart is combined with the tongue at uttering it. Thus, whosoever gave charity, performed Haj or Umrah and made his intention to dedicate the reward of any of the above devotional acts to a deceased, it will reach the latter if Allah wills despite making the inention in the heart only."
In this regard, Al-Imam Al-Shabremalsee (May Allah have mercy on his soul) stated: "Whosoever intended to dedicate the reward of reciting Quran for a deceased, supplicated after the recitation for the purpose of dedicating it to the latter or it took place at his grave, in this case, both (The reciter and the deceased)will have the reward of the recitation; yet, if the reciter didn't get his reward for a worldly goal such as gaining money in return of the recitation, then the reward of the recitation will be the deceased's only. [Nihayat Al-Muhtaj vol.12 pp.275].
Moreover, Ibn Al-Qayim Al-Jawziah (May Allah have mercy on his soul) stated: "If people inquire: is uttering one's intention stipulated so that the reward will reach the intended person/the deceased or making the intention in the heart for the same purpose will suffice? The reply will be: "Prophetic Sunnah didn't condition the utterance of one's intention while dedicating the reward of a good deed to others in one narration, but it permitted performing an act of devotion on behalf of someone else and its validity wasn't combined with the utterance such as fasting, Hajj and charity, since Allah, may He be Praised Knows the intention of His slaves and the purpose behind performing any act. Thus, uttering the intention before initiating the good deed is permissible and making the intention in the heart without uttering it will suffice as well ;besides, the reward of the good deed in both cases will reach the intended person with no need to say: "O Allah I will fast tomorrow on behalf of A the son of B." [The book of Arou'h]. And Allah Knows Best.