5 Replies Latest reply on Apr 18, 2012 10:33 AM by Cody Lerum

    Seam mail - unable to configure smtp server

    Ryan Carlson Newbie

      I'm trying to configure Seam mail to do email templating and sending for a project and I'm stuck trying to get configure seam/jboss to use our smtp server.  I'm using jboss 7.1.1.FINAL and using seam mail 3.1.0.Beta4.  Other dependencies are listed in pom.xml file snippet below.  I didn't include the full file, just seam/mail dependencies.  If it would be helpful to see more, let me know.


      What I'm seeing is that it's always trying to find an smtp server on localhost (port 25) instead of the values I'm setting in both beans.xml and standalone-full.xml.  Thus when I get to m.send() I get an exception.. Connection refused.  Stacktrace is attached.  When I step through in debug mode, I see the property: mail.smtp.host=localhost .  Am I not setting this in the correct location, or are there possibly dependencies missing in my pom?


      I didn't find any examples to go from online, so any help here would be most appreciated!  Thanks!


      @Inject private Instance<MailMessage> message;


          public String submitRequest() throws Exception{


                  VelocityTemplate vt = new VelocityTemplate(new FileInputStream("/Applications/jboss-7.1.1/standalone/deployments/helpdesk-ee6.war/resources/email/emailTemplate.vm"));

                  String str = vt.merge(new HashMap<String,Object>());


                  MailMessage m = message.get();

                  m.to(new InternetAddress("ryan dot t dot carlson at myorg dot org,"Ryan T. Carlson"))

                  .from(new InternetAddress("ryan dot t dot carlson at myorg dot org,"Ryan T. Carlson""))





              catch(FileNotFoundException fnfe){



              return "foo";



      <beans xmlns="http://java.sun.com/xml/ns/javaee"




             xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://docs.jboss.org/cdi/beans_1_0.xsd">


          <mail:MailConfig serverHost="smtp1.myorg.org" serverPort="25">






































      <subsystem xmlns="urn:jboss:domain:mail:1.0">

           <mail-session jndi-name="java:Mail">

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




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

           <remote-destination host="smtp1.myorg.org" port="25"/>



      Message was edited by: Ryan Carlson -cleaned up email addresses in code snippet