The Messenger of Allah ﷺ was given the comprehensive expressions of good and their conclusions, or he said the openings of good, so he taught us the address for prayer and the address for any need.The address for prayer is, "All greetings, prayers, and good things belong to Allah. Peace be upon you, Prophet, and the mercy of Allah and His blessings. Peace be upon us and upon the righteous servants of Allah. I bear witness that there is no god but Allah, and I bear witness that Muhammad is His servant and His Messenger."The address for any need is, "All praise belongs to Allah. We praise Him, we seek His help, and we seek His forgiveness. We take refuge with Allah from the evils of our own selves and from our wicked deeds. Whomever Allah guides, none can lead astray, and whomever He leads astray, none can guide. I bear witness that there is no god but Allah alone, who has no partner, and I bear witness that Muhammad is His servant and His Messenger."Then you join to your address three verses from the Book of Allah, "You who believe, fear Allah as He should be feared, and do not die except as Muslims" [Al Imran 3:102], "People, fear your Lord, who created you from a single soul and created from it its mate, and from the two of them spread abroad many men and women. Fear Allah, in whose name you make requests of one another, and be mindful of family ties. Allah is ever watchful over you" [Nisa 4:1], "You who believe, fear Allah and speak with words that are upright, and He will set your deeds right for you and forgive you your sins" [Ahzab 33:70–71].
أوتي رسول الله ﷺ جوامع الخير، وخواتمه، أو قال فواتح الخير، فعلمنا خطبة الصلاة وخطبة الحاجة، خطبة الصلاة: التحيات الله والصلوات والطيبات، السلام عليك أيها النبي ورحمة الله وبركاته السلام علينا وعلى عباد الله الصالحين، أشهد أن لا إله إلا الله وأشهد أن محمدا عبده ورسوله، وخطبة الحاجة أن الحمد لله نحمده ونستعينه ونستغفره ونعوذ بالله من شرور أنفسنا ومن سيئات أعمالنا، من يهده الله فلا مضل له، ومن يضلل فلا هادي له، وأشهد أن لا إله إلا الله وحده لا شريك له، وأشهد أن محمدا عبده ورسوله، ثم تصل خطبتك بثلاث آيات من كتاب الله {يأيها الذين ءامنوا اتقوا الله حق تقاته ولا تموتن إلا وأنتم مسلمون} [سورة آل عمران: ١٠٢] {يأيها الناس اتقوا ربكم الذي خلقكم من نفس واحدة وخلق منها زوجها وبث منهما رجالا كثيرا ونساء واتقوا الله الذي تساءلون به والأرحام إن الله كان عليكم رقيبا} [سورة ساء: ١] {أيها الذين ءامنوا اتقوا الله وقولوا قولا سديدا يصلح لكم أعملكم ويغفر لكم ذنوبكم} [ سورة الأحزاب: ٧٠-٧١].
Abu Dawud (2118), Tirmidhi (1105), Nasai (3277), and Ibn Majah (1892) all narrated it through routes from Abu Ishaq, from Abu Ahwas, from Abdullah bin Masud, who mentioned it. Ibn Khuzayma (270) and Ibn Hibban (1952) graded it sahih, though some of them limited it to the tashahhud in prayer only. Its chain of transmission is sahih.