0 Replies Latest reply on Aug 6, 2008 4:53 PM by chkiron chronos

    Problem sending email

    chkiron chronos Newbie

      Hi all!

      I have a problem and perhaps you can help me. I wrote a class to send email in my application using commons-email. Here is the code:

      import org.apache.commons.mail.SimpleEmail;
      
      (...)
      
      SimpleEmail email = new SimpleEmail();
      try {
       email.setHostName(smtp);
       email.setAuthentication(user, pwd);
       email.addTo(to, aliasTo);
       email.setFrom(from, aliasFrom);
       email.setSubject(subject");
       email.setMsg(message);
       email.send();
      } catch (Exception e) {
       e.printStackTrace();
      }


      It works fine when I use it outside JBOSS, running it as a Java Application (and a main()).

      But, when I invoke the class through JBOSS, all international characters go scrambled and the subject gets lost!

      Does anyone have some idea to help me ? I am searching thru a lot of code, googling since yesterday, but I got stuck :(

      Thank you in advance!