2 Replies Latest reply on Sep 7, 2006 2:22 PM by Peter Pei Guo

    Configure JavaMail in JBoss

    Peter Pei Guo Newbie

      I am looking for a way to configure JavaMail in JBoss, so that I can send mail by looking up context. I did find something online, but the information was really old, and I couldn't even find the the files mentioned (I amusing version 4, and the post was for version 2).

      Please help. Thanks,

        • 1. Re: Configure JavaMail in JBoss
          fss Newbie

          This post should be in: Installation, Configuration & Deployment

          you can configure your mail-properties in deploy/mail-service.xml.

          <?xml version="1.0" encoding="UTF-8"?>
          <!DOCTYPE server>
          <!-- $Id: mail-service.xml,v 2005/06/01 06:20:43 starksm Exp $ -->
           <!-- ==================================================================== -->
           <!-- Mail Connection Factory -->
           <!-- ==================================================================== -->
           <mbean code="org.jboss.mail.MailService" name="jboss:service=Mail">
           <attribute name="JNDIName">java:/TESTMail</attribute>
           <attribute name="Configuration">
           <property name="mail.transport.protocol" value="smtp"/>
           <property name="mail.smtp.host" value="testmail.test.de"/>
           <property name="mail.debug" value="false"/>

          From your code you get the mailsession with a normal jndi loookup
          Object objref = context.lookup(_mailSessionJNDI);
          Session mail (Session) PortableRemoteObject.narrow(objref, Session.class);