Mike,
Actually in my case I am not sending email from a web application so I do not
have a web.xml. I created a simple Message Driven Bean which is listening to a
queue. Each entry that arrives in this queue is an email that needs to be sent.
In my MDB I just do a JNDI lookup to get a reference to the mail session and
then send the email. You could basically send email in a similar manner as I am
doing it by just deploying the mail-service.xml file and then doing lookups
from a servlet or a helper class. You could do that even without having to
declare anything in your web.xml. In case you need it, here is some sample code.
| Session mailSession = (Session)jndiContext.lookup("java:/MailService");
| MimeMessage mimeMessage = new MimeMessage(mailSession);
| mimeMessage.setFrom();
| etc..
|
|
Given the mail-service.xml I posted earlier, MailService would be bound to JNDI
and it will return a session to you when you do a look up.
Javier
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3878689#3878689
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3878689
-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user