This content has been marked as final.
Show 4 replies
-
1. Re: How do I send an email inside an EJB3 Session Bean
fhh Apr 13, 2007 2:05 PM (in response to mrchit_2000)Inject the java:/Mail object (or look it up via JNDI) to get a mail session. (You have to configure it first.)...
... or use some simplified library like commons-mail.
Regards
Felix -
2. Re: How do I send an email inside an EJB3 Session Bean
mrchit_2000 Apr 13, 2007 9:52 PM (in response to mrchit_2000)Hi,
How do I inject the resource? Any library I need to download?
I tried to do this but it did not work.@Resource private javax.mail.Session session;
It complains javax.mail.Session is not found.
Thanks a lot,
LNgo -
3. Re: How do I send an email inside an EJB3 Session Bean
asack Apr 14, 2007 10:32 AM (in response to mrchit_2000)"mrchit_2000" wrote:
Hi,
How do I inject the resource? Any library I need to download?
I tried to do this but it did not work.@Resource private javax.mail.Session session;
It complains javax.mail.Session is not found.
Thanks a lot,
LNgo
You can do a simple context lookup of the /Mail object in JNDI space. Please use the JMX console and dump your JNDI view to make sure its registered. Look in $JBOSS_HOME/server/default/deploy for a mail-service.xml file which configures the mail service. -
4. Re: How do I send an email inside an EJB3 Session Bean
mrchit_2000 Apr 14, 2007 7:09 PM (in response to mrchit_2000)Hi,
I managed to send an email. I download the JavaMail jar and include into my project then the complain of the javax.mail.Session is gone.
Thanks,
LNgo