-
1. Re: Send mails from MBean
raja05 Sep 25, 2005 3:43 AM (in response to bnadesan)There should be a mail-service.xml in the deploy directory jsut for this purpose. You can bind to the JNDI name for the mail services which is java:/Mail. It binds the JavaMail Session to this name which can be used in client applications.
Just make sure that your mbean depends on mail-service so that the JNDI Name is bound by mail-service before you start using it in ur mbean. -
2. Re: Send mails from MBean
rke21 Oct 20, 2005 12:28 PM (in response to bnadesan)Context initial = new InitialContext();
Session session =
(Session) initial.lookup("java:/Mail/WhateverYouWantCallIt");
msg = new MimeMessage(session);
Now you're all good to go. Just use java mail api. You'll use the transport to send it. -
3. Re: Send mails from MBean
patman Nov 8, 2005 6:19 AM (in response to bnadesan)Check www.jboss.com/wiki/Edit.jsp?page=ManifestInspectorMBean
the attachment has source code in it, that does what you want. -
4. Re: Send mails from MBean
patman Nov 8, 2005 6:22 AM (in response to bnadesan)Oops, that would be http://wiki.jboss.org/wiki/Wiki.jsp?page=ManifestInspectorMBean instead, sorry.