Can We Greet Non-Mahrams With Salam?
Question

Is it permissible for me to return the Salam of a woman who is a stranger to me, i.e., a non-Mahram?
Praise be to Allah.The command to spread Salam 
Allah has commanded us to spread the greeting of Salam, and has enjoined us to return the greeting to all Muslims. He has made the greeting of Salam one of the things that spread love among the believers. 
Allah says (interpretation of the meaning): 
"When you are greeted with a greeting, greet in return with what is better than it, or (at least) return it equally. Certainly, Allah is Ever a Careful Account Taker of all things." [An-Nisa' 4:86]
And it was narrated that Abu Hurayrah said: The Messenger of Allah (peace and blessings of Allah be upon him) said: "You will not enter Paradise until you (truly) believe, and you will not (truly) believe until you love one another. Shall I not tell you something which, if you do it, you will love one another? Spread the greeting of Salam amongst yourselves." (Narrated by Muslim, 54) 
In the answer to question no. 4596 , there is a lengthy discussion on the importance of greeting with Salam and returning the greeting. 
Obligation for all Muslims to initiate and return the greeting of Salam 
The command to spread the greeting of Salam is general and applies to all the believers. It includes men greeting men and women greeting women, and a man greeting his female Mahrams. All of them are enjoined to initiate the greeting of Salam, and the other is obliged to return the greeting . 
But there is a special ruling that applies to a man greeting a non-Mahram woman, because of the Fitnah (temptation) that may result from that in some cases. 
Can we greet non-Mahrams with Salam?
There is nothing wrong with a man greeting a non-Mahram woman with Salam, without shaking her hands , if she is elderly , but he should not greet a young woman with Salam when there is no guarantee that there will be no Fitnah (temptation). This is what is indicated by the comments of the scholars, may Allah have mercy on them.  
Imam Malik was asked: Can a woman be greeted with Salam? He said: With regard to the elderly woman, I do not regard that as disliked, but with regard to the young woman, I do not like that. 
Az-Zarqani explained the reason why Malik did not like that, in his commentary on Al-Muwatta': Because of the fear of Fitnah when he hears her returning the greeting. 
In Al-Adab Ash-Shar`iyyah (1/370) it says: Ibn Muflih mentioned that Ibn Mansur said to Imam Ahmad: (What about) greeting women with Salam? He said: If the woman is old there is nothing wrong with it. 
Salih (the son of Imam Ahmad) said: I asked my father about greeting women with Salam. He said: With regard to old women, there is nothing wrong with it, but with regard to young women, they should not be prompted to speak by being made to return the Salam. 
An-Nawawi said in his book Al-Adhkar (p. 407): 
“Our companions said: Women greeting women is like men greeting men. But when it comes to women greeting men, if the woman is the man's wife, or his concubine, or one of his Mahrams, then it is like him speaking to another man ; it is recommended for either of them to initiate the greeting of Salam and the other is obliged to return the greeting. But if the woman is a stranger (non-Mahram), if she is beautiful and there is the fear that he may be tempted by her, then the man should not greet her with Salam, and if he does then it is not permissible for her to reply; she should not initiate the greeting of Salam either, and if she does, she does not deserve a response. If he responds then this is disliked. 
If she is an old woman and he will not be tempted by her, then it is permissible for her to greet the man with Salam and for the man to return her Salam. 
If there is a group of women then a man may greet them with Salam, or if there is a group of men, they may greet a woman with Salam, so long as there is no fear that any of the parties may be tempted. 
Abu Dawud (5204) narrated that Asma’, the daughter of Yazid said: "The Prophet (peace and blessings of Allah be upon him) passed by us women and greeted us with Salam." (Classed as authentic by Al-Albani in Sahih Abu Dawud). 
And Al-Bukhari (6248) narrated that Sahl ibn Sa`d said: "There was an old woman of our acquaintance who would send someone to Buda`ah (a garden of date-palms in Madinah). She would take the roots of Silq (a kind of vegetable) and put them in a cooking pot with some powdered barley. After we had prayed Jumu`ah, we would go and greet her, then she would offer (that food) to us." 
Al-Hafidh said in Al-Fath: 
“Concerning the permissibility of men greeting women with Salam and women greeting men: what is meant by its being permitted is when there is no fear of Fitnah . 
Al-Halimi was quoted as saying: Because the Prophet (peace and blessings of Allah be upon him) was infallible and protected from Fitnah. Whoever is confident that he will be safe from temptation may greet (women) with Salam, otherwise it is safer to keep silent. 
And Al-Muhallab is quoted as saying: It is permissible for men to greet women with Salam and for women to greet men, if there is no fear of Fitnah. 
And Allah knows best.