It is believed that Brahma and the sage Valmiki performed penance in this site. As the result, Vishnu appeared to them.
Although I could not find this information in any source material, the Vaishnavites of this village believe that this village called Anbil is the birthplace of the sage Valmiki.
There is one more information which is believed by the localities for which I could not find any appropriate source. As the pride of Brahma was subdued by Vishnu through his love in this site, the site is called as Anbil. The word "Anbu" means love/affection in Tamil language.
The legend related to Brahma's penance and Vishnu's appearance goes like this. Brahma believed that he was the most handsome person. Vishnu cursed him to be born as a human. Brahma, who was born as human, did penance towards Vishnu, in this site. Vishnu appeared as a very handsome man. (The name of the deity in this temple means very beautiful Lord). Brahma realized that Vishnu was more beautiful than him. Thus, Vishnu taught him the lesson that one should not get proud due to his own personal appearance. Ultimately, Brahma got rid of his curse too.
As per another legend, a sage was performing penance under water. Hence, he did not notice the sage Durvasa who was waiting to meet him. The agitated Durvasa cursed the other sage to become a frog. In Sanskrit, the word frog is referred as "Manduka". The sage who turned into a frog was hence called as Manduka Rishi. As the frog, the sage continue his penance under water and got darshan of Vishnu. He also regained his original form. The holy tank is named after the sage as Manduka Teerth.
Anbil had various other names in the past. Some of the names are Mandookapuri, Brahmapuri, Tirumaalayanthurai and Premapuri.
It is believed that the temple was built or rebuilt by Sundara Chola (10th century CE). His minister, the famous Aniruddha Brahmarayar, was from this village. Sundara Chola's copper plates are very popular among the historians. Anbil copper plates are one of the major sources for the Chola history.
The temple that was built by the Cholas got the contributions from the Vijayanagaras and the Nayakas later.
The inscriptions of Kulotunga Chola I, Rajendra Chola III, Hoysala King Veera Ramanatha Deva, Vijayanagara King Devaraya Maharaja and many other stone inscriptions are found in the temple complex.
The Chola generals used to keep their weapons under the feet of Vishnu in this temple before leaving for the battle.
The east facing temple has a three tiered Raja Gopuram. The east facing sanctum's vimana is very attractive. It is called as Taraka Vimana.
The presiding deity of the temple is Vadivazhagiya Nambi. It is a very beautiful name in Tamil language which denotes about the physically beautiful Lord. Nambi is found in the reclining posture, rested on the serpent Sesha. His right arm is found as if his head is slightly resting on it. His consorts Sri Devi and Bhoo Devi are found near his feet. Brahma is found emerging out of his navel. This posture of Vishnu is called as Bhujanka Sayanam.
The utsav deity is called as Sundara Raja Perumal. The temple is nowadays called after his name. Sundara Raja Perumal is found along with his two Devis. In addition, the utsav Murti of Andal is also found nearby. The unique feature of the idol is that she is found in the sitting posture. Andal is generally found standing, and hence it is unique. All these utsav deities are also located in the sanctum.
Bali peetha is located outside the Raja Gopuram in this temple. Garud is found facing towards the sanctum. One more idol of Garud and the north facing Andal are found in the Maha Mandap area.
In the Ardha Mandap, the small stone idols of Ramanuja, Manavala Mamuni, Alwars, Venu Gopala, Yoga Narasimha, Bhakta Anjaneya and Veera Anjaneya are found. Venu Gopala is found with four arms and is playing flute. Veera Anjaneya is found with his left arm raised, which is a unique feature. He is generally found raising his right arm above his head.
The temple has just one prakara. The shrine of the Goddess Azagiya Valli Thayar is found in the prakara. As per her name, she is very beautiful. Her shrine is facing east direction.