Thaali or Mangalsutra is not mentioned in either Ramayan or Mahabharat. Only place where I can find reference is in Sree Lalita Sahasranamam. Kameshwar Mahadev tied Mangalsutra to Devi Tripura Sundari.
Kamesena baddam yanmangalyasutram, tena sobhita kandara yasyah sa
She whose neck is bedecked with the “mangalya sutra” tied by Lord Kamesvara
Source: Sree Lalita Sahasranamam 30th Name
In south Indian marriages, there is a verse chanted by the priest which goes like:
Mangalyam tantunanena mama jeevana hetuna
Kanthe badhnami subhage twam jeeva sarada satam
It means 'This is a sacred thread. This is essential for my long life. I tie this around your neck, O maiden having many auspicious attributes may you live happily for a hundred years.'