Simple example about sending mail on WildFly. :-)
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)