Sayyiduna Abu Kabshah (may Allah be pleased with him) narrates that the Messenger of Allah (peace and blessings be upon him) was sitting when a woman passed by, so he (peace and blessings be upon him) got up and went to his family. Then the Messenger of Allah (peace and blessings be upon him) came out to us while (water) was dripping (from him (peace and blessings be upon him)). We said: O Messenger of Allah! It seems something has happened? He (peace and blessings be upon him) said: "Yes, so-and-so passed by me and desire for women arose in my heart, so I went to one of my wives. You too should do likewise, for going to what is lawful is among the best of your deeds."
Hadith Referenceالمعجم الكبير للطبراني / مسند من يعرف بالكنى / 19051