Rasulullah S.A.W. said "It is better for a man that a steel nail be driven through the centre of his head....rather than if he touches the palm of a strange women"
The hadith is a narration of Ma'qil ibn Yasaar (Radhiallahu Anhu) who narrates that Nabi (Sallallahu Alaihi wasallam) said: "It is better for an iron rod (nail, needle etc) to be driven into the head of a man, than for him to touch a woman who is not permissible for him." The hadith is narrated by the great Hafiz of Hadith , at-Tabrani, in his al-Mu'jam al-Kabir (Vol.20 Pg.211) and by the Muhaddith al-Ruyaani, in his Musnad (Vol.2 Pg.323).
This narration has been classified as Sahih (authentic) by Allamah ibn Hajr al-Haitami in his az-Zawajir while both Hafiz Munzhiri in his at-Targheeb wat Tarheeb (Vol.3 Pg.26) and Hafiz Nuruddeen Haithami in Majma'uz Zawaid (Vo.4 Pg.326) have classified all its narrators as reliable narrators of Sahih Muslim.