عن أبي هريرة رضي الله عنه أن رسول الله صلى الله عليه و سلم قال قال رجل لأتصدقن الليلة بصدقة فخرج بصدقته فوضعها في يد سارق فأصبحوا يتحدثون تصدق الليلة على سارق فقال اللهم لك الحمد على سارق لأتصدقن بصدقة فخرج بصدقته فوضعها في يد زانية فأصبحوا يتحدثون تصدق الليلة على زانية فقال اللهم لك الحمد على زانية لأتصدقن بصدقة فخرج بصدقته فوضعها في يد غني فأصبحوا يتحدثون تصدق الليلة على غني فقال اللهم لك الحمد على سارق وزانية وغني فأتي فقيل له أما صدقتك على سارق فلعله أن يستعف عن سرقته وأما الزانية فلعلها أن تستعف عن زناها وأما الغني فلعله أن يعتبر فينفق مما أعطاه الله رواه البخاري واللفظ له ومسلم والنسائي قالا فيه فقيل له أما صدقتك فقد تقبلت ثم ذكر الحديث (الترغيب و الترهيب 1/69)
Hadhrat Abu Hurayrah (Radhiallahu Anhu) reports that Rasulullah (Sallallahu Alaihi Wasallam) said: “Once there was a person who said: ‘Tonight I will most certainly give out some sadaqah.’ He then proceeded to distribute his sadaqah and (unknowingly) placed it in the hands of a thief. The next morning the people began discussing that sadaqah was given the previous night to a thief. When this news reached him, the man then said (in shock and surprise): ‘O Allah, to You belongs all praise. (However my sadaqah) had went into the hands of a thief. The man then resolved to give sadaqah once again on the second night. He then proceeded to distribute his sadaqah and (unknowingly) placed it in the hands of an immoral woman. The next morning the people began discussing that sadaqah was given the previous night to an immoral woman. When this news reached him, the man then said (in shock and surprise): ‘O Allah, to You belongs all praise. (However my sadaqah) had went into the hands of an immoral woman. The man then resolved to give sadaqah once more on the third night. He then proceeded to distribute his sadaqah and (unknowingly) placed it in the hands of a rich person. The next morning the people began discussing that sadaqah was given the previous night to a rich man. When the man heard of this, he said (in shock and surprise): ‘O Allah, to You belongs all praise, despite the fact that my sadaqah had reached the hands of a thief, an immoral woman and a rich person (during the previous three nights).’ The man then saw a dream wherein he was informed that (on account of your ikhlaas in discharging the sadaqah on those three nights, the outcome of the ikhlaas was that): ‘The sadaqah you gave to the thief, (then that sadaqah) became a means of preventing him from stealing. The sadaqah you gave to the immoral woman, (then that sadaqah) became a means of preventing her from her immorality. The sadaqah you gave to the rich man, (then that sadaqah) became a means of him taking lesson, and also spending from the wealth which Allah Ta’ala had bestowed upon him.