Problems connecting SMTP using java mail API
843834Dec 30 2008 — edited Feb 4 2009Hi,
Our mail server is CLTHSP01. We are trying login to the server using a username and copy a message to the "sent items" folder.
When we try to login using the code
Store store = session.getStore("smtp");
store.connect("clthsp01", 25, "username","password");
we are getting the below mentioned Exception "NoSuchProviderException"
javax.mail.NoSuchProviderException: invalid provider at javax.mail.Session.getStore(Session.java:542) at
javax.mail.Session.getStore(Session.java:508) at javax.mail.Session.getStore(Session.java:487) at
But when we telnet into the server using the command "telnet clthsp01 25"
we see the message "220 nc.nbgfn.com ESMTP Sendmail 8.13.6/8.13.6; Tue, 30 Dec 2008 16:41:50 -0500 (EST)"
Please let us know why we can connect to the SMTP using telnet and not through code. Thanks!