This content has been marked as final.
Show 3 replies
-
1. Re: JavaMail problem
markash Aug 29, 2006 6:15 AM (in response to damijanv)Good Day,
Try the following code.InitialContext ctx = new InitialContext() ; Session mailSession = (Session) ctx.lookup("java:Mail") ; Message msg = new MimeMessage(mailSession); InternetAddress toAddrs[] = new InternetAddress[1]; toAddrs[0] = new InternetAddress("damijan@hit.si"); msg.setRecipients(Message.RecipientType.TO, toAddr); msg.setFrom(); msg.setSubject("Takeoff time."); msg.setSentDate(new Date()); String content = new String("Test"); msg.setText(content); Transport.send(msg);
http://www.javaworld.com/javaworld/jw-10-2001/jw-1026-javamail.html
Regards,
Mark P Ashworth -
2. Re: JavaMail problem
damijanv Aug 29, 2006 6:34 AM (in response to damijanv)Hello again,
I tried the code you sugessted but I am getting the same exception on msg.setText(String)
"java.lang.NoSuchMethodError: javax.activation.DataHandler.(Ljava/lang/Object;Ljava/lang/String;)V"
Best regards,
Damijan -
3. Re: JavaMail problem
damijanv Aug 30, 2006 3:09 AM (in response to damijanv)Found the solution. The mail.jar and activation.jar that commes with Jboss 4.0.4 have to be replaced with mail.jar from JavaMail1.4 and activation.jar from jaf1.1. I replaced the jar in server/${config_name}/lib folder.
Best regards,
Damijan