[Machine] The pleasure (mut'ah) existed in the early days of Islam, and they used to recite this verse {So whatever you enjoy [of marriage] from them} [Quran 4:24] to give them their dowries. A man would propose to a woman without having any knowledge of her, and he would marry her as much as he deemed necessary to satisfy his needs, protect his belongings, and improve his situation. Until this verse was revealed {Forbidden to you [for marriage] are your mothers} [Quran 4:23] until the end of the verse. Allah replaced the previous ruling, thus making mut'ah (temporary marriage) forbidden and abrogating its mention in the Quran, except for their wives or those their right hands possess. Anything other than this is considered Haram (forbidden).
كَانَتِ الْمُتْعَةُ فِي أَوَّلِ الْإِسْلَامِ وَكَانُوا يَقْرَءُونَ هَذِهِ الْآيَةَ {فَمَا اسْتَمْتَعْتُمْ} [النساء 24] بِهِ مِنْهُنَّ فَآتُوهُنَّ أُجُورَهُنَّ الْآيَةَ فَكَانَ الرَّجُلُ يَقْدَمُ الْبَلْدَةَ لَيْسَ لَهُ بِهَا مَعْرِفَةٌ فَيَزَّوَّجُ بِقَدْرِ مَا يَرَى أَنَّهُ يَفْرُغُ مِنْ حَاجَتِهِ لِتَحْفَظَ مَتَاعَهُ وَتُصْلِحُ لَهُ شَأْنَهُ حَتَّى نَزَلَتْ هَذِهِ الْآيَةُ {حُرِّمَتْ عَلَيْكُمْ أُمَّهَاتُكُمْ} [النساء 23] إِلَى آخِرِ الْآيَةِ فَنَسَخَ اللهُ ﷻ الْأُولَى فَحُرِّمَتِ الْمُتْعَةُ وَتَصْدِيقُهَا مِنَ الْقُرْآنِ {إِلَّا عَلَى أَزْوَاجِهِمْ أَوْ مَا مَلَكَتْ أَيْمَانُهُمْ} [المؤمنون 6] وَمَا سِوَى هَذَا الْفَرْجِ فَهُوَ حَرَامٌ