The Qur'an encourages marriage but does not prohibit a relationship before marriage with a potential marriage partner. Part of verse 2:235 refers to marriage stating, 'do not make a promise of marriage to them in secret except speaking an honourable saying'. As is often the case with interpretation of the Qur'an, the meaning becomes clear when considering the full context of the verse. In this case, reading verse 2:234 immediately before this verse reveals that the verses are referring to women whose husbands have died and they are in a 'prescribed term' which has to pass before they remarry:
Those of you who die and leave spouses behind them, they shall wait four months and ten days, and when they have fulfilled their term, there is no sin on you if they dispose of themselves in a just and honourable manner. God is well-acquainted with all that you do. You commit no error whether you make a hint of marriage or conceal it in yourself, God knows that you will remember them, but do not make a promise of marriage to them in secret except speaking an honourable saying. Do not confirm the marriage until the term prescribed is fulfilled. Know that God knows what is in your minds, so be conscious of Him. Know that God is Oft-Forgiving, Most Forbearing. (2:234-235) وَالَّذِينَ يُتَوَفَّوْنَ مِنْكُمْ وَيَذَرُونَ أَزْوَاجًا يَتَرَبَّصْنَ بِأَنْفُسِهِنَّ أَرْبَعَةَ أَشْهُرٍ وَعَشْرًا فَإِذَا بَلَغْنَ أَجَلَهُنَّ فَلا جُنَاحَ عَلَيْكُمْ فِيمَا فَعَلْنَ فِي أَنْفُسِهِنَّ بِالْمَعْرُوفِ وَاللَّهُ بِمَا تَعْمَلُونَ خَبِيرٌ وَلا جُنَاحَ عَلَيْكُمْ فِيمَا عَرَّضْتُمْ بِهِ مِنْ خِطْبَةِ النِّسَاءِ أَوْ أَكْنَنْتُمْ فِي أَنْفُسِكُمْ عَلِمَ اللَّهُ أَنَّكُمْ سَتَذْكُرُونَهُنَّ وَلَكِنْ لا تُوَاعِدُوهُنَّ سِرًّا إِلا أَنْ تَقُولُوا قَوْلا مَعْرُوفًا وَلا تَعْزِمُوا عُقْدَةَ النِّكَاحِ حَتَّى يَبْلُغَ الْكِتَابُ أَجَلَهُ وَاعْلَمُوا أَنَّ اللَّهَ يَعْلَمُ مَا فِي أَنْفُسِكُمْ فَاحْذَرُوهُ وَاعْلَمُوا أَنَّ اللَّهَ غَفُورٌ حَلِيمٌ
The prescribed term is described as 'four months and ten days' in the above passage. Therefore, verse 2:235 is specifically referring to a ruling of not making promises of marriage to a woman who is still within that refraining period of four months and ten days. The verse is not a general prohibition of discussing marriage with a potential marriage partner.
In verse 4:23, a list of women is outlined whom a man is forbidden to marry. In the next verse, marriage is encouraged with those whom we are allowed to marry and God specifically mentions we can choose whomever we like for marriage:
Also forbidden to you are women already married, other than those whom your right hands possess. This is what God has ordained for you. All others are lawful, as long as you seek them for marriage with a marital gift from your wealth, desiring chastity and not committing illegal sexual intercourse. Hence, for any of them whom you like / choose, give them their marital gift as ordained. You would commit no error if you make a mutual agreement regarding the marital gift. God is indeed All-Knowing, All-Wise. (4:24) وَالْمُحْصَنَاتُ مِنَ النِّسَاءِ إِلا مَا مَلَكَتْ أَيْمَانُكُمْ كِتَابَ اللَّهِ عَلَيْكُمْ وَأُحِلَّ لَكُمْ مَا وَرَاءَ ذَلِكُمْ أَنْ تَبْتَغُوا بِأَمْوَالِكُمْ مُحْصِنِينَ غَيْرَ مُسَافِحِينَ فَمَا اسْتَمْتَعْتُمْ بِهِ مِنْهُنَّ فَآتُوهُنَّ أُجُورَهُنَّ فَرِيضَةً وَلا جُنَاحَ عَلَيْكُمْ فِيمَا تَرَاضَيْتُمْ بِهِ مِنْ بَعْدِ الْفَرِيضَةِ إِنَّ اللَّهَ كَانَ عَلِيمًاحَكِيمًا
The emphasis in the above verse is marriage while avoiding illicit sexual activities and encouraging permissible marriage to those whom we choose or have a liking for. In other words, the verse is about avoiding promiscuity/adultery but at the same time it is clear that God does not discourage using our own initiative for finding a suitable marriage partner.
In the verse below, God highlights that both men and women have been created in this world so that they may know one another. Hence, when seeking a potential marriage partner, God makes no restriction on making friends with the opposite gender for the purpose of general friendship or potential marriage:
Oh mankind, We created you from a male and a female and made you into nations and tribes so that you may know one another. (49:13) يَا أَيُّهَا النَّاسُ إِنَّا خَلَقْنَاكُمْ مِنْ ذَكَرٍ وَأُنْثَى وَجَعَلْنَاكُمْ شُعُوبًا وَقَبَائِلَ لِتَعَارَفُوا
In the verse below, God explicitly states that believing males and females are friends to one another. As such, there is no prohibition on good interaction between males and females, for general friendship or potential marriage:
The believing males and the believing females are friends to one another. (9:71) وَالْمُؤْمِنُونَ وَالْمُؤْمِنَاتُ بَعْضُهُمْ أَوْلِيَاءُ بَعْضٍ
Note that the above verses do not restrict a male and female from meeting on their own for social reasons or friendship. As long as they have positive intentions, this may be a way to meet new friends, keep contact with old friends, or perhaps finding a potential marriage partner.
The following two verses encourage marriage but prohibit taking 'illicit partners':
Whoever of you do not have the means to wed free, believing women, they may wed believing women from those whom your right hands possess. God has full knowledge about your faith, you are one from another. Wed them with the permission of their own folk, and give them their marital gift according to what is reasonable; they should be chaste, not committing illegal sexual intercourse or taking illicit partners. After they have been taken in wedlock, if they commit illegal sexual intercourse, their punishment is half that for free women. This is for those among you who are afraid of falling into evil; it is better that you practise self-restraint, and God is Oft-Forgiving, Most Merciful. (4:25) وَمَنْ لَمْ يَسْتَطِعْ مِنْكُمْ طَوْلا أَنْ يَنْكِحَ الْمُحْصَنَاتِ الْمُؤْمِنَاتِ فَمِنْ مَا مَلَكَتْ أَيْمَانُكُمْ مِنْ فَتَيَاتِكُمُ الْمُؤْمِنَاتِ وَاللَّهُ أَعْلَمُ بِإِيمَانِكُمْ بَعْضُكُمْ مِنْ بَعْضٍ فَانْكِحُوهُنَّ بِإِذْنِ أَهْلِهِنَّ وَآتُوهُنَّ أُجُورَهُنَّ بِالْمَعْرُوفِ مُحْصَنَاتٍ غَيْرَ مُسَافِحَاتٍ وَلا مُتَّخِذَاتِ أَخْدَانٍ فَإِذَا أُحْصِنَّ فَإِنْ أَتَيْنَ بِفَاحِشَةٍفَعَلَيْهِنَّ نِصْفُ مَا عَلَى الْمُحْصَنَاتِ مِنَ الْعَذَابِ ذَلِكَ لِمَنْ خَشِيَ الْعَنَتَ مِنْكُمْ وَأَنْ تَصْبِرُوا خَيْرٌ لَكُمْ وَاللَّهُ غَفُورٌ رَحِيمٌ
Made lawful to you this day are all good and pure things. The food of the people of the Scripture is lawful to you and yours is lawful to them. Lawful to you for marriage are chaste women from the believers and chaste women from those who were given the Scripture before your time, when you have given them the marital gift, desiring chastity, not committing illegal sexual intercourse or taking illicit partners. Whoever rejects faith in God, then fruitless is his work, and in the Hereafter they will be among the losers. (5:5) الْيَوْمَ أُحِلَّ لَكُمُ الطَّيِّبَاتُ وَطَعَامُ الَّذِينَ أُوتُوا الْكِتَابَ حِلٌّ لَكُمْ وَطَعَامُكُمْ حِلٌّ لَهُمْ وَالْمُحْصَنَاتُ مِنَ الْمُؤْمِنَاتِ وَالْمُحْصَنَاتُ مِنَ الَّذِينَ أُوتُوا الْكِتَابَ مِنْ قَبْلِكُمْ إِذَا آتَيْتُمُوهُنَّ أُجُورَهُنَّ مُحْصِنِينَ غَيْرَ مُسَافِحِينَ وَلا مُتَّخِذِي أَخْدَانٍ وَمَنْ يَكْفُرْ بِالإِيمَانِ فَقَدْ حَبِطَ عَمَلُهُ وَهُوَفِي الآخِرَةِ مِنَ الْخَاسِرِينَ
The Arabic word used for 'illicit partners' is AKHDAN, based on the trilateral root letters Kha-Da-Na خ د ن , which according to Arabic Lexicons relates to an 'amorous companion' with a 'sensual appetency'. This kind of companion cannot be equally compared to a committed and sincere relationship between a couple who are intending and aiming for marriage. The verses refer to individuals who engage in illicit and meaningless relationships, or temporary 'love affairs', which are very different to faithful, loyal and committed relationships with marriage as their goal.
One may ask the question: 'If the Qur'an encourages people to get married, why would a couple remain in a relationship before marriage?' The answer may be seen in verse 24:33, in which God acknowledges there are circumstances in which a couple may not be able to get married immediately and it may be better for them to wait until circumstances improve:
Let those who cannot find the ability to get married refrain until God enriches them of His Bounty. (24:33) وَلْيَسْتَعْفِفِ الَّذِينَ لا يَجِدُونَ نِكَاحًا حَتَّى يُغْنِيَهُمُ اللَّهُ مِنْ فَضْلِهِ
If a couple like each other in a solely faithful relationship and they are sincere, committed and aiming for marriage like the Qur'an encourages, this is a very permissible type of relationship and is unlike the other illicit type of relationships mentioned in some verses. In the situation where a faithful couple like each other, God does not say that they should stop having these affections, nor that they should immediately get married regardless of their circumstances. In situations of difficulty, God encourages patience, but does not prohibit committed relationships until marriage becomes possible. If the aim is for marriage and the couple are committed to each other, there is no reason why such relationships would not be blessed or approved by God.