Does Islam permit friendships with members of the opposite gender?
Friendship between individuals of the opposite gender is permitted. The Sharia establishes principles regulating relations between human beings in order to allow for societal interactions that are in accordance with Islamic values. Qur’anic injunctions order both men and women to lower their gaze and protect their private parts (24:30). It also instructs women to wear garments that cover their bodies (33:33) and speak in a manner that does not incite lust (33:32). However, there are also narrations that instruct men from not entering a place where women are uncovered and discourages men and women mixing in seclusion.
The fact that Sharia has laid down rules for interaction between genders implies that such interactions are allowed, since had it been absolutely prohibited, there would have been no prescribed conditions and guidance in the Qur’an. Therefore, the aforementioned narrations prohibiting relations between opposite genders have to be understood as prohibiting interactions that may lead to immorality and not all relations per se. Furthermore, we know that during the time of the holy Prophet, women used to approach the Prophet and his companions, to ask them about various different issues. Similarly, Lady Aisha and Umm Salama were highly revered and also consulted by men and approached for advice. See Is it permitted to attend gatherings where members of the opposite gender are present?
 Muslim, Ṣaḥīḥ al-Muslim, vol. 1, p. 32; Abū Dāwūd, Sunan Abī Dāwūd, vol. 2, p. 533, hadith no. 5272.