Hey Dimitris,
I would if I could, but as soon as the MimeMessage(mailSession) constructor is 
called and InvocationTargetException is thrown, then I see the 
java.lang.NoClassDefFoundError: com/sun/mail/util/SharedByteArrayInputStream

Here is my method:

public void sendMessage() {
        
        try {
                Session mailSession =  null;
                        
                try { 
                                Context ctx = new InitialContext();
                                Object objref = ctx.lookup("java:/Mail");
                                mailSession = (Session) 
PortableRemoteObject.narrow(objref, Session.class); 
                        } catch (NamingException e) {
                                
                                System.out.println(e);
                                e.printStackTrace();
                        }
                
                        MimeMessage msg = new MimeMessage(mailSession);
                        
                        msg.setSubject(subject);
                        msg.setSentDate(new Date());
                        msg.setFrom();
                        msg.setRecipients(Message.RecipientType.TO, 
getAddresses());
                        msg.setText(mailMessage); 

                        Transport.send(msg);
                
        }
        catch (MessagingException e) {
                logger.log(Level.SEVERE, "messaging error: ", e);
        } 
    }

Bob



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

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3980094
_______________________________________________
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to