Abu Usaid al-Ansari reported:
The Messenger of Allah (May peace be upon him) as saying: When any of you enters the mosque he should invoke blessing on the prophet (may Allah bless him and grant him peace) and then he should say: (Allahumma iftahli abwaba rahmatik) O Allah, open to me the gates of thy mercy. And when he goes out, he should say: (Allahumma inni as'aluka min fadlik) O Allah, I ask thee out of Thine abundance.
Fatimah narrated:
"When Allah's Messenger entered the Masjid he said Salat and Salam upon Muhammad and then said: (Rabbighfirli dhunubi, waftahli abwaba rahmatik) 'O pardon my sins, and open the gates of Your mercy for me.' And when he exited he said Salat and Salam upon Muhammad, and then said: (Rabbighfirli dhunubi, waftahli abwaba fadlik) 'O Lord pardon my sins, and open the gates of Your blessings for me.'"