Originally posted by A Kumar: Any changes to be done?
Well, if it "doesn't work" then I would say something has to be changed to make it work. But not knowing what "doesn't work" actually means, it's pretty hard to suggest what needs to be changed. So I would suggest you start by reading the JavaMail FAQ page. You are almost certain to find the answer there.