Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Problems connecting SMTP using java mail API

843834Dec 30 2008 — edited Feb 4 2009
Hi,

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!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 4 2009
Added on Dec 30 2008
13 comments
1,544 views