Reference: Fataawa Muhimmah li-Nisaa. al-Ummah – Page 229
Question: I am a university student, and sometimes I extend salaam to the female students. So is it halaal or haraam for a male student to extend salaam to his female colleagues at university?
Response: Firstly, it is not permissible to study with females in one place (together), nor in one school (together), and nor in one class (together), rather this is from amongst the greatest causes of fitnah. So it is not permissible for a male student nor a female student to [freely] mix like this for that which exists therein of much fitnah. As regards extending the salaam, then there is no harm for him to extend the salaam, as is outlined in the Sharee’ah, to her, so long as there is no display of any causes of fitnah. And [likewise], there is no harm for her to extend the salaam to him without shaking hands, because shaking hands between the two ajnabees is not permissible, rather the extending of salaam should be from a distance with/in hijaab and keeping far away from [all] causes of fitnah, and without being alone [together]. So the salaam, as outlined in the Sharee’ah, in which there is no fitnah, there is no harm in [extending] this. As for extending the salaam to her in such a manner as to cause fitnah or her extending salaam to him in such a manner that arouses his desires and excites him in that which Allaah has prohibited, then this is not allowed in the Sharee’ah (i.e. it is prohibited). And with Allaah lies [all] success.