Praise be to Allaah.
Al-Bukhaari (6491) and Muslim (131) narrated from Ibn ‘Abbaas (may Allaah be pleased with him) that the Prophet (peace and blessings of Allaah be upon him) said, relating from his Lord, may He be glorified and exalted: “Allaah decreed good deeds and bad deeds, then He explained that. Whoever thinks of doing a good deed then does not do it, Allaah will write it down as one complete good deed. If he thinks of doing a good deed and then does it, Allaah [may He be glorified and exalted] will write it down between ten and seven hundred fold, or many more. If he thinks of doing a bad deed then he does not do it, Allaah will write it down as one complete good deed, and if he thinks of it then does it, Allaah will write it down as one bad deed.”
Al-Haafiz Ibn Hajar said in Fath al-Baari (11/325).
This indicates that the angel can see what is in the heart of the human being, either because Allaah informs him of it or because Allaah has granted him some knowledge by means of which he is able to find it out.
The former view is supported by the report narrated by Ibn Abi’l-Dunya from Abu ‘Imraan al-Jawni who said: He calls out to the angel: Write down such and such for So and so, and he says: O Lord, he did not do it. He says: He intended it.
And it was said that the angel detects a foul odour when a person is thinking of doing a bad deed, and he detects a good smell for a good deed. That was narrated by al-Tabaraani from Abu Ma’shar al-Madani. A similar report was narrated from Sufyaan ibn ‘Uyaynah.
Shaykh al-Islam Ibn Taymiyah (may Allaah have mercy on him) was asked about the words of the Prophet (peace and blessings of Allaah be upon him), “When a person thinks of doing a good deed but does not do it, one good deed is recorded for him…” If his thinking about it is something hidden and is between him and his Lord, how can the angels see it?
Praise be to Allaah. An answer to this question was narrated from Sufyaan ibn ‘Uyaynah, who said: If he thinks of doing a good deed, the angel smells a good fragrance, and if he thinks of doing a bad deed, the angel smells a foul odour.
In fact, Allaah is able to tell the angels what is in a person’s heart in whatever manner He wishes. End quote.
Majmoo’ al-Fataawa (4/253)
And he (may Allaah have mercy on him) also said:
Even if they smell the good scent and foul odour, their knowledge is not dependent on what they smell; rather they know what is in the heart of the human being, they can hear it and see the whispers of his nafs. Even the shaytaan gets hold of his heart, and when he remembers Allaah he retreats, but if his heart neglects to remember Allaah he starts to whisper. He knows whether he is remembering Allaah or neglecting to remember Him, and he knows what his nafs desires or is inclined towards, and he makes that attractive to him.
It is proven in al-Saheeh from the Prophet (peace and blessings of Allaah be upon him) in a hadeeth narrated by Safiyyah (may Allaah be pleased with her) that “The shaytaan flows through the son of Adam like blood.”
The fact that the angels and the shaytaan are close to a person’s heart is something that is mentioned in numerous reports which reach the level of tawaatur, whether the person is a believer or a disbeliever. End quote from Majmoo’ al-Fataawa (5/508).
As for what a person thinks in his heart without moving his tongue and uttering it, he will be rewarded for that, but it is not the particular reward that is bestowed by the Lawgiver to the one who mentions that, rather that reward comes for speaking, and speaking is only achieved by uttering the words. But there are some scholars who say that moving the tongue is sufficient even if there is no sound that can be heard. This is the view of the Maalikis and is the view favoured by Shaykh al-Islam Ibn Taymiyah, that it is sufficient to move the lips even if the words cannot be heard. End quote.
The majority of scholars think that it is essential to speak the words loud enough to be heard by oneself. Al-Nawawi (may Allaah have mercy on him) said in Sharh al-Muhadhdhab (3/120): If he cannot hear himself then it is not an announcement or speech. End quote.
He also said: It should be noted that the adhkaar that are prescribed in prayer and elsewhere, whether they are obligatory or mustahabb, do not count for anything unless they are uttered so that he can hear himself if his hearing is sound. Al-Adhkaar (42).
Adopted from islam-qa