Sayyida Aisha Siddiqa (may Allah be pleased with her) narrates: The Prophet Muhammad (peace be upon him) would take (the pledge of allegiance) from women only for that thing which Allah Almighty had commanded him. The blessed hand of the Prophet Muhammad (peace be upon him) never touched the hand of any woman. When he would take the pledge from those women, he would say to them: I have taken your pledge by words.
Sayyiduna Abdullah bin Abbas (may Allah be pleased with them both) narrates as a marfu’ hadith that the Prophet Muhammad (peace and blessings be upon him) said: “No man should have bodily contact with another man, and no woman should have bodily contact with another woman.”