Authentic Supplication Number 069.

About the Messenger of Allah , he said: "When one of you enters the Masjid let him petition salam upon the Prophet , and let him say: 'Allahumma 'iftahlee 'abwaba rahmatika (83), and upon leaving let him say: 'Allahumma 'innee 'as'aluka min fadhlika (84)." In one narration he added: And petition salam upon the Messenger when leaving.

Footnotes.
(83) 0 my 'ilah open for me the gates of your mercy.
(84) O' my 'ilah I ask You of your benevolence.

Reporters.
Ibn Taymiya said this hadeeth was sound, and that Muslim reported it with nearly the same wording. Al-Albani clarified that this wording is that of Abu Dawood, as well as that of Abu `Uwanah in his Saheeh except that Abu 'Uwanah's report added "and making tasleem when going out''. Al-Albani included this hadeeth in his Saheeh 'Abi Dawood and in his The Authentic of Good Sayings as #49.