2 Replies Latest reply on Feb 29, 2012 1:46 AM by traxdata

    urn:jboss:domain:mail Settings

    traxdata

      Hello guys,

       

      I want to switch from Glassfish to JBoss due the new ultrafast version released.

      I'm currently setting up the email ressource for my application.

       

      My problem is that I don't know how to set the values I need to set.

      I want to set a default from-email in the email ressource in jboss7.1-FINAL.

       

      Here's what I got so far...

       

       

      {code:xml}

      <mail-session jndi-name="java:jboss/mail/Argos">

         <smtp-server outbound-socket-binding-ref="mail-smtp">

            <login name="default" password="default" />

         </smtp-server>

      </mail-session>

       

       

      <outbound-socket-binding name="mail-smtp">

         <remote-destination host="SOME_IP" port="SOME_PORT"/>

      </outbound-socket-binding>

      {code}

       

      In glassfish the configuration looks like this

       

       

      {code:xml}

      <mail-resource host="SOME_IP" store-protocol="smtp" store-protocol-class="com.sun.mail.smtp.SMTPStore" jndi-name="mail/Argos"

                from="Argos@prosystemsit.de" user="default"></mail-resource>

      {code}

       

      The thing I want to set is the "FROM" value. The reciever would see this value in his email as sthe sender's email.

        • 1. Re: urn:jboss:domain:mail Settings
          jaikiran

          Matthias, welcome to the forums!

           

          The xsd for the mail subsystem is at JBOSS_HOME/docs/schema/jboss-as-mail_1_0.xsd. As per the xsd you can use the "from" attribute of the mail-session element:

          <xs:complexType name="mail-sessionType">
                  ...
          
                  <xs:attribute name="from" use="optional">
                      <xs:annotation>
                          <xs:documentation>
                              <![CDATA[
                                      sets mail.from attribute
                                  ]]>
                          </xs:documentation>
                      </xs:annotation>
                  </xs:attribute>
          ...
          

           

          So just add the from attribute to the mail-session element that you already have

          • 2. Re: urn:jboss:domain:mail Settings
            traxdata

            Thank you You saved my day!