He (Sheikhul Islam IbnTaymiyyah) was asked about a man who prays a grammatically blundered prayer,then a person said to him:
“Allaah will not accept a prayer that is grammatically wrong”
Whoever uttered this statement has committed a sin and gone against the Book (Al-Qur’an), Sunnah (of Allaah’s messenger (commendations and peace of Allaah be upon him)) and what the salaf (pious predecessors) were upon.
Whoever calls on Allaah purifying the religion for him (i.e. with Islamic monotheism) and with a permissible prayer, Allaah will listen to him and answer his prayer, whether it is grammatically correct or wrong.
Therefore, the above mentioned statement has no basis. Rather, it is necessary for the praying person not to burden himself with grammar if he is not used to grammar. Some of the salaf said:
If grammar comes concentration goes.
Also, it is disliked to burden oneself with rhyming in prayer but if it occurs without burdening then there is no problem. (This is) because the origin of prayer is from the heart and the tongue is only following the heart.
Whoever makes his goal in prayer to be straightening, (then) his tongue will weaken the concentration of his heart and this is why the anguished makes a prayer that is inspired to him and he never knew before. And this is a matter that every believer finds in his heart. So prayer is permissible in Arabic and in other than Arabic.
Allaah the exalted knows the intention and will of the caller, even if his tongue is not straight because he knows what the voice mutters irrespective of the language and irrespective of the needs.”
From Tasheeh-Du’a by Sheikh Bakr Abu Zayd. May Allaah have mercy on him and Sheikhul Islam.