It is narrated from Sayyiduna Jabir (may Allah be pleased with him) that the Prophet (peace and blessings of Allah be upon him) said: When any one of you sees a woman and he is attracted to her, he should go to his wife, for this will remove from his heart what he is feeling.
Hadith Referenceمسند احمد / مسند المكثرين من الصحابة / 14744
Hadith Gradingحکم دارالسلام:صحيح لغيره، م: 1403، وهذا إسناد ضعيف لسوء حفظ ابن الهيعة، وانظر: 14537