about the exception from the mail servlet

This is with reference to the previous post: Frank:I used the code that you had posted in an earlier message.Still I get the exception NoSuchProviderException:no provider for address type rfc822. Can anybody help?? ***************************************************** import javax.servlet.*; import javax.servlet.http.*; import java.util.*; import java.io.*; import java.net.InetAddress; import javax.mail.*; import javax.mail.internet.*;

Frank: Yes both the jar files are in the classpath,also I added pop3.jar too.The server has been restarted so that the new path is taken by the server.That part is pretty clear.Still I got the earlier exception.I tried another construct: Transport trans = new com.sun.mail.smtp.SMTPTransport(session, new URLName(urlname)); where urlname is: String urlname = "smtp://"+ smtpHost +":"+ port; Now I didnt get the Exception but I didnt get the mail either. I used smtpHost in form xxx.xxx.com and port is a number.So finally I have smtp://xxx.xxx.com:25 I have no idea how to make this work.Help!!!

Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920

posted Aug 24, 2000 10:58:00

0

Wierd. It works quite happily for me. Which server and Java version are you using?

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944

posted Aug 24, 2000 11:45:00

0

Frank: I am using weblogic server 5.1.0 and I am using java 2 with jdk1.2.2.The code was written in textpad.Someone mentioned that there can be access problem with the server,so I am looking into that.Any other suggestions??

Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920

posted Aug 25, 2000 02:07:00

0

I've never used or configured Weblogic, but I can say that my mail code works OK in most other servlet containers I've tried. Sorry I couldn't be more help.

Unfortunately,I am still working on the problem.Looks like my code is alright but there is some security issues.I downloaded the javawebserver2.0 to test the code and now I have the exception:java.security.AccessControlException: access denied (java.net.SocketPermission xxx.xxx.com resolve) at java.security.AccessControlContext.checkPermission What kind of security permission is it asking for?After all I am trying to send an email to myself. jhonghua:I tried the code that you posted and I have the same exception. FYI:my code was not developed on visual age or any IDE,its written from scratch in textpad.

"kant28, zhonghua, fordsm", Some of these posts are really old, but you should all be aware that the Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at http://www.javaranch.com/name.jsp . We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. If you haven't already done so, please log in with a new name which meets the requirements. Thanks.