Hi Senthil,
When you are testing the code in local system are you getting same exception?
Could you please post/email me a sample file to tset your code. Also please mention the rules of the file content based on which you are determining the receiver.
Regards
Anupam