Re: problem sending javamail

From: Ulas Ergin (ulasergin_at_hotmail.com)
Date: 12/26/03

  • Next message: BenDimock: "applets in non-plugin IE"
    Date: 26 Dec 2003 00:27:44 -0800
    
    

    make sure that mail.jar and activation.jar is in the classpath of the servlet

    nilambari_p@hotmail.com (Nilambari) wrote in message news:<80d6973b.0312230156.16057b2c@posting.google.com>...
    > hi
    >
    > i am facing a problem for SMTPTransport.openserver......
    >
    > i am getting following error when i am trying to send email using
    > javamail servlet:
    >
    > java.lang.NoSuchMethodError:
    > com.sun.mail.util.TraceInputStream.setQuote(Z)V
    > at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:956)
    > at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:191)
    > at javax.mail.Service.connect(Service.java:233)
    > at javax.mail.Service.connect(Service.java:134)
    > at geezmail.makeTable(geezmail.java:169)
    > at geezmail.doPost(geezmail.java:99)
    >
    > and the log says invalid protocoll: null
    >
    > Following is my code for sending email:
    >
    > Properties props = System.getProperties();
    > //props.setProperty("mail.host", "cyber");
    > props.setProperty("mail.smtp.host", "127.0.0.1");
    > props.setProperty("mail.transport.protocol", "smtp");
    > props.setProperty("mail.smtp.port", "25");
    > props.setProperty("mail.user", "");
    > props.setProperty("mail.password", "");
    >
    > Session mailSession = Session.getDefaultInstance(props, null);
    > mailSession.setDebug(true);
    > Transport transport = mailSession.getTransport("smtp");
    > //URLName urlname = new URLName("www.geezemail.com");
    > //com.sun.mail.smtp.SMTPTransport transport = new
    > com.sun.mail.smtp.SMTPTransport(mailSession, urlname);
    >
    > MimeMessage message = new MimeMessage(mailSession);
    > message.setContent(msg, "text/html");
    > if (from.length() == 0){
    > return
    > "<center><table border=0>" +
    > "<tr>" +
    > "<td><H2>" + "From: field is not provided." +
    > "</H2></td>" +
    > "</tr>" +
    > "</table></center>";
    > }
    > else if (to.length() != 0) {
    > message.addRecipient(Message.RecipientType.TO, new
    > InternetAddress(to));
    > if (cc.length() != 0)
    > message.addRecipient(Message.RecipientType.CC, new
    > IernetAddress(cc));
    > if (bcc.length() != 0)
    > message.addRecipient(Message.RecipientType.BCC, new
    > InternetAddress(bcc));
    > message.setSubject(subject);
    > InternetAddress reply[] = new InternetAddress[1];
    > reply[0] = new InternetAddress(from);
    > message.setReplyTo(reply);
    > transport.connect("127.0.0.1",25,"","");//169
    > //message.saveChanges();
    > transport.sendMessage(message,
    > message.getRecipients(Message.RecipientType.TO));
    > transport.close();
    >
    >
    > Can anybody help me?
    >
    > Nilambari
    > nilambari_p@hotmail.com


  • Next message: BenDimock: "applets in non-plugin IE"

    Relevant Pages

    • Re: problem sending javamail
      ... make sure that mail.jar and activation.jar is in the classpath of the servlet ... > Following is my code for sending email: ...
      (comp.lang.java.help)
    • Re: problem sending javamail
      ... make sure that mail.jar and activation.jar is in the classpath of the servlet ... > Following is my code for sending email: ...
      (comp.lang.java.programmer)
    • Re: cant find a class...
      ... >> It is a good idea to never set your CLASSPATH environment variable. ... >thank you very much for your response, Tony... ... Tomcat knows where its libraries are, ... J2EE stuff (which is where the servlet stuff is). ...
      (comp.lang.java.help)
    • Re: cant find a class...
      ... > It is a good idea to never set your CLASSPATH environment variable. ... thank you very much for your response, Tony... ... tomcat I don't need to set CLASSPATH? ... even though my servlet finally compiled fine I can't run it, ...
      (comp.lang.java.help)
    • Re: jsps and tomcat
      ... I opened the servlet that was ... It was just compiled by tomcat. ... >> able to compile it a little while ago. ... >> do i need to place certain things in my classpath to compile the servlet ...
      (comp.lang.java.programmer)