Al-Adab Al-Mufrad, Book 40, Hadith 932 (English) ⓘ
Abu Hurayra said, "Two men sat in the presence of the Prophet may Allah bless him and grant him peace, and one of them was from a noble family than the other. The nobler of the two sneezed and did not praise Allah, so the Prophet did not ask for mercy for him. Then the other man sneezed and praised Allah, so the Prophet, may Allah bless him and grant him peace, asked for mercy on him. The noble man said, 'I sneezed in your presence and you did not ask for mercy for me. This other than sneezed and you asked for mercy on him.' The Prophet said, 'This man mentioned Allah, so I mentioned him. You forgot Allah, so I forgot you.'"
حَدَّثَنَا مُحَمَّدُ بْنُ سَلامٍ، قَالَ: حَدَّثَنَا رِبْعِيُّ بْنُ إِبْرَاهِيمَ هُوَ أَخُو ابْنِ عُلَيَّةَ، قَالَ: حَدَّثَنَا عَبْدُ الرَّحْمَنِ بْنُ إِسْحَاقَ، عَنْ سَعِيدِ بْنِ أَبِي سَعِيدٍ، عَنْ أَبِي هُرَيْرَةَ قَالَ: جَلَسَ رَجُلاَنِ عِنْدَ النَّبِيِّ صلى الله عليه وسلم أَحَدُهُمَا أَشْرَفُ مِنَ الْآخَرِ، فَعَطَسَ الشَّرِيفُ مِنْهُمَا فَلَمْ يَحْمَدِ اللَّهَ، وَلَمْ يُشَمِّتْهُ، وَعَطَسَ الْآخَرُ فَحَمِدَ اللَّهَ، فَشَمَّتَهُ النَّبِيُّ صلى الله عليه وسلم، فَقَالَ الشَّرِيفُ: عَطَسْتُ عِنْدَكَ فَلَمْ تُشَمِّتْنِي، وَعَطَسَ هَذَا الْآخَرُ فَشَمَّتَّهُ، فَقَالَ: إِنَّ هَذَا ذَكَرَ اللَّهَ فَذَكَرْتُهُ، وَأَنْتَ نَسِيتَ اللَّهَ فَنَسِيتُكَ.
also referenced under: Hadith 932 (Reference) & Book 40, Hadith 932 (In-Book)