greeting brother muslims is one of these islamic practices which are hallmark of a muslim and its merits have been anointed in many ahadith e.g. "one who takes precedence in greeting others is closer to allah." (abu daud)
it is not necessary to greet only those with whom one is acquainted; greeting strangers who are known to be muslim is a matter of great merit.
our holy prophet, may he be divinely blessed eternally, was asked as to which actions are good for muslim. among the actions which he enumerated was this: "you should greet people whether you know them or not."
it is reported about abdullah bin omar that sometimes he went out of the house only to greet any muslims he met and thus to increase his merit. (muvatta imam malik)
the correct interpretation of this hadith, however, is that one should greet others, though not everyone one sees because it is impossible and it might be embarrassing for others. (al adab al shahriah, li ibn muslih page 422, vol 1)
it is also a sunnah to greet the family when entering the house. our holy prophet instructed his personal servant anas as follows, " on son! when you enter (your) house, greet your family members; this act shall be of benefit for both you and your family members." (tirmidhi) even when entering an empty house one should greet with the intent that angels are being greeted.
haidth also urges the muslims to clearly speak out the greeting so that it may be heard and understood. although the sunnah of greeting is fulfilled by saying 'al salam alaikum', adding 'rahmat ullah wa barakatuhu' earns more merit.
imran bin husayn recounts that once he and others were in the presence of our exalted and eternally blessed prophet when a man came and said, "assalamo alaikum", to which the blessed prophet responded and said, "ten" (i.e. the person who had greeted him had earned ten merits); then another man came and he "assalamo alaikum wa rahmatullah", to which the blessed prophet responded and said "twenty" (i.e. the person had earned twenty merits). finally a third man came and said "assalamo alaikum wa rahmatullah wa barakatu", to which the exalted prphet responded and said, "thirty" (i.e. the person had earned thirty merits) (abu daud, tirmidhi, jami al usul, p. 602. vol 6)
it should be noted here, however, that salaam i.e. is a sunnah only when the person greeted is not busy or when salaam would not disturb him. if salaam is going to disturb him in whatever he is doing, e.g. reciting quran or doing dikhir or tending the sick of studying or doing something else in which loss of concentration would cause loss, the one should wait till the work is finished.
similarly, it is not right to salaam when somebody is making a speech, and the speaker too should not do it. however, if a group is sitting quietly and somebody passes by then he should greet them. if someone wishes to join them then just one salaam is enough and a single response from one of the group fulfills the sunnah.
to be the first with salaam is sunnah and he who does not reply to is a sinner.
when a letter is received in which "salaam alaikum" is written, it should be responded to in the prescribed manner while reading the letter.