[jboss-user] [Beginners Corner] - Problem sending email

chkiron do-not-reply at jboss.com
Wed Aug 6 16:53:02 EDT 2008


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!

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4169147#4169147

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4169147



More information about the jboss-user mailing list