You can configure mail service by editing mail-service.xml file in your deploy
directory.
Sample code:
| import javax.mail.Transport;
| import javax.mail.Session;
| import javax.ejb.SessionContext;
|
| @Stateless
| public class SessionBean implements ISessionBeanLocal{
| @Resource(mappedName="java:/Mail")
| private Session mailSession;
|
| @Resource
| private SessionContext ctx;
|
| public void sendAMessage(){
| MimeMessage m = new MimeMessage(session);
| m.setFrom(fromAddress);
| ............
| Transport.send(m)
| }
|
| public void legacySend(){
| Session mailSession = (Session)PortableRemoteObject.narrow(
| ctx.lookup("java:/Mail"), Session.class);
| MimeMessage m = new MimeMessage(session);
| m.setFrom(fromAddress);
| ............
| Transport.send(m)
| }
| }
|
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3914746#3914746
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3914746
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user