General discussion

  • Creator
    Topic
  • #2074559

    email problem in SunOs using javax mail

    Locked

    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 = “del1@gtaonline.com;//here we givw the SMTP server ip
    String filename =
    “/home/airtel/apache/apache_1.3.9/www/htdocs/airtel/coverage.htm”;

    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(“mail.smtp.host”, host);

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

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

All Comments

Viewing 0 reply threads