Skip to content

Latest commit

 

History

History
39 lines (30 loc) · 1 KB

README.md

File metadata and controls

39 lines (30 loc) · 1 KB

send-mail-server

Simple example about sending mail on WildFly. :-)

Configuration JavaMail in WildFly 8

Example into standalone.xml

<mail-session name="App" jndi-name="java:/mail/gmail">
   <smtp-server outbound-socket-binding-ref="mail-smtp-gmail" ssl="true" 
      username="[email protected]" password="your_password"/>
</mail-session>
<outbound-socket-binding name="mail-smtp-gmail">
   <remote-destination host="smtp.gmail.com" port="465"/>
</outbound-socket-binding>

Example with jboss-cli

/socket-binding-group=standard-sockets/
   remote-destination-outbound-socket-binding=mail-smtp-gmail:add(host=smtp.gmail.com,port=465)
/subsystem=mail/mail-session=App:add(jndi-name=java:/mail/gmail,from="[email protected]",debug=true)
/subsystem=mail/mail-session=App/
   server=smtp:add(outbound-socket-binding-ref=mail-smtp-gmail, 
                     [email protected], password=your_password, ssl=true)