0 Replies Latest reply on Mar 16, 2007 11:05 AM by Alessandro Ilardo

    mail-service.xml - multiple smtp accounts

    Alessandro Ilardo Newbie

      Hello there,
      I'm developing a message driven bean able to send emails.
      As I'm quite new with EJB3 and JBoss, I first looked for more informations about it and if I'm not wrong I need to configure the mail-service.xml file.
      The question is:
      can I set multiple smtp accounts? I mean, I probably need to use one account only for a particulary EJB module and not share it across the others applications deployed in JBoss.

      the file now looks like this, can you give me an idea, if possible, on how to achieve what I'd like to.
      Thanks in advance.

       <!-- ==================================================================== -->
       <!-- Mail Connection Factory -->
       <!-- ==================================================================== -->
       <mbean code="org.jboss.mail.MailService"
       <attribute name="JNDIName">java:/Mail</attribute>
       <attribute name="User">nobody</attribute>
       <attribute name="Password">password</attribute>
       <attribute name="Configuration">
       <!-- Test -->
       <!-- Change to your mail server prototocol -->
       <property name="mail.store.protocol" value="pop3"/>
       <property name="mail.transport.protocol" value="smtp"/>
       <!-- Change to the user who will receive mail -->
       <property name="mail.user" value="nobody"/>
       <!-- Change to the mail server -->
       <property name="mail.pop3.host" value="pop3.nosuchhost.nosuchdomain.com"/>
       <!-- Change to the SMTP gateway server -->
       <property name="mail.smtp.host" value="smtp.nosuchhost.nosuchdomain.com"/>
       <!-- Change to the address mail will be from -->
       <property name="mail.from" value="nobody@nosuchhost.nosuchdomain.com"/>
       <!-- Enable debugging output from the javamail classes -->
       <property name="mail.debug" value="false"/>