Gayathri,
Please not the code tags are [code] and not <code>. Or you can use the Code button.
We have a forum dedicated for
java mail. I will move this
thread there for you.
What error did you get when you say [i]"we couldn't connect to the gmailserver"[i]. Can you post the stack trace?
Is there any firewall blocking the port?