Hi All,

I'm trying to use javamail with servlet to send a mail

I'm using Netscape Enterprise Server 3.5.1
All class paths are properly set

I'm getting   "java.lang.ClassNotFoundException  " on
the below

Session session = Session.getDefaultInstance(props,
null);

Please let me know how can I solve this problem

Thanks,

Vikram

Part of my code is below:
----------------------------------------------------------------------
import javax.servlet.*;
import javax.servlet.http.*;
import java.util.*;
import java.io.*;
import java.net.*;
import java.sql.*;
import java.util.Date;
import java.text.SimpleDateFormat;
import JavaServer.Communication.*;
import javax.mail.*;
import javax.activation.*;
import javax.mail.internet.*;

:
:
:

   public void pageProjectSendMail( String vemailfrom,
String vemailto, String vemailcc, String vsubject,
String vdata )
   throws ServletException, IOException
   {
        :
        :
        :
        :

        Properties props = new Properties();

       props.put("mail.smtp.host",
"gmsmtp01.oraclecorp.com");


       Session session =
Session.getDefaultInstance(props, null);  ( code is
failing on this line
java.lang.ClassNotFoundException )
      MimeMessage msg = new MimeMessage(session);
     msg.setFrom(new InternetAddress(vemailfrom));

     InternetAddress[] toaddress = {new
InternetAddress(vemailto)};
     msg.setRecipients(Message.RecipientType.TO,
toaddress);
     msg.setRecipients(Message.RecipientType.CC,
vemailcc);
     msg.setSubject(vsubject);
     MimeBodyPart mbp = new MimeBodyPart();
     mbp.setText(vdata);
     Multipart mp = new MimeMultipart();
     msg.setContent(mp);
        msg.setSentDate(new Date());
        Transport.send(msg);

:
:
:
:
-------------------------------------------------------


__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/

___________________________________________________________________________
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

Reply via email to