3 Replies Latest reply on Dec 4, 2006 3:31 AM by mp123

    Sending Email using JBoss AS 4.0.4GA??

    mp123

      Hello Folks,

      I have configured the mail-service.xml file in deploy directory correctly to send a mail. I need to send an email from my application using JBoss AS 4.0.4GA.

      How come I accomplish this? How to write a program to send email using JBoss AS?

      Please help me.

      Thanks in Advance,

        • 1. Re: Sending Email using JBoss AS 4.0.4GA??
          weston.price

          Please do not cross post between forums. It does not get your question answered any faster and only clutters the forums with duplicate respones. Further, if you crost post you aren't guaranteed to get a pleasant response ;-)

          There is nothing fundamentally different about sending mail in JBoss versus using the regular JavaMail API. I would suggest looking at the JavaMail tutorial, or the Java Almanac code examples involving JavaMail.

          The only *real* difference is in how a Mail Session is acquired. This is done via JNDI and should be done using a resource reference.

          A quick example can be found here:

          http://java.sun.com/j2ee/sdk_1.2.1/techdocs/guides/ejb/html/Advanced3.html.

          There are quite a few examples and tutorials on this topic around. A simple Google will serve you well.

          • 2. Re: Sending Email using JBoss AS 4.0.4GA??
            mp123

            Hello,

            Thank you very much for your quick response. Now, I got the idea.
            Sorry for the duplicate post.

            • 3. Re: Sending Email using JBoss AS 4.0.4GA??
              mp123

              Hello,

              "weston.price@jboss.com" wrote:


              The only *real* difference is in how a Mail Session is acquired. This is done via JNDI and should be done using a resource reference.


              Now, I have stuck with this point on how to create Mail Session using JNDI and how to edit the ejb-jar.xml and jboss.xml of my application.

              Please tell me, how can I add the entry in ejb-jar.xml for mail sending?