title: configure gmail in jboss 7.1.1
body: <p>I am using jboss 7.1.1 and want to send email using JavaMail.I have tried with following configuration but getting error .Has anyone configured gmail with Jboss 7.1.1 ?</p>
  
  <pre><code> &lt;socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}"&gt;
      &lt;socket-binding name="management-native" interface="management" port="${jboss.management.native.port:9999}"/&gt;
      &lt;socket-binding name="management-http" interface="management" port="${jboss.management.http.port:9990}"/&gt;
      &lt;socket-binding name="management-https" interface="management" port="${jboss.management.https.port:9443}"/&gt;
      &lt;socket-binding name="ajp" port="8009"/&gt;
      &lt;socket-binding name="http" port="8080"/&gt;
      &lt;socket-binding name="https" port="8443"/&gt;
      &lt;socket-binding name="jacorb" interface="unsecure" port="3528"/&gt;
      &lt;socket-binding name="jacorb-ssl" interface="unsecure" port="3529"/&gt;
      &lt;socket-binding name="messaging" port="5445"/&gt;
      &lt;socket-binding name="messaging-throughput" port="5455"/&gt;
      &lt;socket-binding name="osgi-http" interface="management" port="8090"/&gt;
      &lt;socket-binding name="remoting" port="4447"/&gt;
      &lt;socket-binding name="txn-recovery-environment" port="4712"/&gt;
      &lt;socket-binding name="txn-status-manager" port="4713"/&gt;
      &lt;outbound-socket-binding name="mail-smtp"&gt;
          &lt;remote-destination host="localhost" port="25"/&gt;
      &lt;/outbound-socket-binding&gt;
      &lt;outbound-socket-binding name="mail-smtp-gmail"&gt;
          &lt;remote-destination host="smtp.googlemail.com" port="587"/&gt;
      &lt;/outbound-socket-binding&gt;
  &lt;/socket-binding-group&gt;
  </code></pre>
  
  <p><strong>Here is mail configuration</strong></p>
  
  <pre><code>&lt;subsystem xmlns="urn:jboss:domain:mail:1.0"&gt;
          &lt;mail-session jndi-name="java:jboss/mail/Default"&gt;
              &lt;smtp-server outbound-socket-binding-ref="mail-smtp"/&gt;
          &lt;/mail-session&gt;
  
           &lt;mail-session jndi-name="java:jboss/mail/TestGmail"&gt;
              &lt;smtp-server outbound-socket-binding-ref="mail-smtp-gmail"&gt;
                  &lt;login name=mymail@gmail.com" password="mypass"/&gt;
              &lt;/smtp-server&gt;
  
          &lt;/mail-session&gt;
  
  &lt;/subsystem&gt;
  </code></pre>