The necessary condition for prayer is the presence of heart, as Prophet Mohammad (pbuh) has said:
“Prayer without presence of heart is devoid of truth.”
“Presence of heart means presence in the heart with all inner powers and all mental and spiritual faculties, so that in seeking God, one is steadfast and no thoughts, good or bad, can interfere, and one is fully committed to the intent of seeking God.” 
Molana Hazrat Shah Maghsoud Sadegh Angha, in Al-Salat states: “O loved one, gather your inner powers and use them in your devotion; remember death at all times; with the strength of Zikr keep the Ka’ba (altar) of the heart free from all other than God; prepare the heart for the acceptance of God’s trust; and labor for the purification of the heart so that it may witness the presence of God.” 
Prophet Mohammad (pbuh) has stated:
“Heaven and earth are unable to contain Me;
but the heart of my devout servant can behold Me.”
The Holy Qur’an states:
Allah does not call you to account for what is vain in your oaths, but He will call you to account for what your hearts have earned, and Allah is Forgiving, Forbearing.
(Holy Qur’an 2:225)
- Sadegh ANGHA, Hazrat Shah Maghsoud, Al-Salat, the reality of Prayer in Islam, M.T.O. Shahmaghsoudi Publication®, Riverside, CA, USA, 1998, p 4.
- Ibid, p 9.