Narrated 'Umar bin Al-Khattab (may Allah be pleased with him):
I heard Allah's Apostle (Peace be upon him) saying, "The reward of deeds depends upon the intentions and every person will get the reward according to what he has intended. So whoever emigrated for worldly benefits or for a woman to marry, his emigration was for what he emigrated for."
Classification
Sahih
References
al-Bukhari Book of Revelation #1al-Bukhari 4
Sahih al-Bukhari Vol. 1, Book 1, Hadith 1
Sahih al-Bukhari Vol. 1, Book of Revelation, Hadith 1