General discussion

  • Creator
  • #2074559

    email problem in SunOs using javax mail


    by anjaligupta76 ·

    I am facing one problem in sending mail.When I execute the class in a
    windows system using a win-nt SMTP server it sends the mail. But the same
    code doesnot run on SunOs system .
    the code is as follows:

    public void send(String fromId,String toId,String subjectLine,String
    textMsg,String thefile)
    String to = toId;
    String from = fromId;
    String host = “;//here we givw the SMTP server ip
    String filename =

    file://boolean debug = Boolean.valueOf(args[4]).booleanValue();
    boolean debug = true;
    String msgText1 = textMsg;
    String subject = subjectLine;

    // create some properties and get the default Session
    Properties props = System.getProperties();
    props.put(“”, host);

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

    // create a message
    MimeMessage msg = new MimeMessage(session);
    msg.setFrom(new InternetA

All Comments

Viewing 0 reply threads