I assume that you're using a kind of certification when you send email.
If so, then the certificate is installed on your localhost and not on your server. Certificates are installed in a directory of the java runtime:
I know that it is a certification issue. But I have also tried one more experiment please help me in this regard.
Now i am sending mail using smtp.gmail.com i am using following session for this and it works fine on my local machine.
<mail:mail-session host="smtp.gmail.com" port="25" username="mygmailaccount" password="mypwd" />
But when i deployed the same code at my server named "soa.telecommand.com" and try to send mail it throws an error that could not
"connect to smtp.gmail.com"
why it is happening and what is the root cause for it plz send me your kind reply
This is very strange because GMAIL doesnt work with port 25.
I used it for testing and used an other port. Try:
<mail:mail-session host="smtp.gmail.com" *port="587"* username="mygmailaccount" password="mypwd" />
See if it works.
Also, you could try telneting gmail from soa.telecommand.com and see if a network misconfiguration is not the cause of the problem.
Thanks a lot for your precious advice. I got my work done successfully by using port 587. This was very confusing term for me because my mail was working fine on port 25 at my local machine but same code didn't work on my server.
But Now it working properly.
Again thanks for this.