I'm working on IIS5.0 with ServletExec server.
I'm using JavaMail in my servlet for sending mail to client mailaddress about
registration confirmation. I'm getting the following error at client browser when
client presses submit button on form. I 've set classpath for mail.jar and
activation.jar on server too. What could be the reason? I've used even setDdebug(true)
on mailsession object. The same code is working fine on my local server/browser with
Java servletrunner.
Error. The server encountered an unexpected condition which prevented it from
fulfilling the request.
java.lang.NoClassDefFoundError: javax/mail/Message
at java.lang.ClassLoader.resolveClass0(Native Method)
at java.lang.ClassLoader.resolveClass(ClassLoader.java:545)
at newatlanta.servletexec.ServletClassLoader.loadClass(ServletClassLoader.java)
at
newatlanta.servletexec.HostServletContext.loadUnconfiguredServlet(HostServletContext.java)
at newatlanta.servletexec.ServletExec.processServletRequest(ServletExec.java)
at newatlanta.servletexec.ServletExec.ProcessRequest(ServletExec.java, Compiled Code)
at newatlanta.servletexec.ServletExec.ProcessRequest(ServletExec.java
And My code goes like...
Properties props = System.getProperties();
props.put("mail.smtp.host", mailhost);
Session session = Session.getDefaultInstance(props, null);
session.setDebug(true);
Message msg = new MimeMessage(session);
msg.setFrom(new InternetAddress(from));
msg.setRecipients(Message.RecipientType.TO,
InternetAddress.parse(E_mail, false));
msg.setRecipients(Message.RecipientType.BCC,
InternetAddress.parse(from, false));
msg.setSubject(subject);
msg.setText(message);
msg.setHeader("X-Mailer", "Registration");
msg.setSentDate(new Date());
Transport.send(msg);
Please help me out. Give me more details on how Javamail will behave?
Thank you.
soumya.
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html