Reference : Hisn al-Muslim 20
أَعوذُ باللهِ العَظيـم
وَبِوَجْهِـهِ الكَرِيـم
وَسُلْطـانِه القَديـم
مِنَ الشّيْـطانِ الرَّجـيم،
[ بِسْـمِ الله، وَالصَّلاةُ وَالسَّلامُ عَلى رَسولِ 
الله]،
اللّهُـمَّ افْتَـحْ لي أَبْوابَ رَحْمَتـِك
'A`ūdhu billāhi l-`aẓīm, 
wa bi-wajhihil-karīm, 
wa sultānihil-qadīm, 
min ash-shaytānir-rajīm. 
[Bismillāhi, wassalātu wassalāmu `alā rasūlillāhi.] 
Allāhummaftaḥ lī 'abwāba raḥmatik.

I seek refuge in Almighty Allah, 
By His Noble Face, 
By His primordial power, 
From Satan the outcast.1 
[In the Name of Allah, and blessings 2 and peace be upon the Messenger of Allah.3
O Allah, open before me the doors of Your mercy.4

Reference:
1. Abu Dawud and Al-Albani, Sahihul-Jdmi' As-Saghir (Hadithno. 4591).
2. Ibn As-Sunni (Hadith no. 88), graded good by Al-Albani.
3. Abu Dawud 1/126, see also Al-Albani, Sahihul-Jami'As-Saghir 1/528.
4. Muslim 1/494. 
There is also a report in Sunan Ibn Majah on the authority of Fatimah (RA), : "O Allah, forgive me my sins and open for me the doors 
of Your mercy." It was graded authentic by 
Al-Albani due to supporting Ahadith. See Sahih Ibn Majah 1/128-9.

Chapter: Upon entering the mosque