Yes you can use it for this purpose:

                        InitialContext ic = new InitialContext();
                        Session session = null;
                        session = (Session) 
ic.lookup(JNDINames.MAIL_SESSION);

                        /* create the session */
                        javax.mail.Message msg = new MimeMessage(session);

Regards,

Harm de Laat
Informatiefabriek
The Netherlands





[EMAIL PROTECTED] 
Sent by: [EMAIL PROTECTED]
11/04/2003 10:33 AM
Please respond to
[EMAIL PROTECTED]


To
[EMAIL PROTECTED]
cc

Subject
[JBoss-user] using mail datasource






Hallo,
for what I can use datasource defined in mail-service.xml? Can I use it
for sending mail or I must send mail by another way?

I tried to use it as :
Context initCtx = new InitialContext();
session = (Session)initCtx.lookup("java:/Mail");
mailMsg = new MimeMessage(session);
...
Transport transport = session.getTransport();
transport.sendMessage(mailMsg, addresses);

But it does not work.
It is not possible to use it for sending or I have some mistake? ...

Thanks, Jiri


-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?   SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user




-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?   SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to