Skip to content

Instantly share code, notes, and snippets.

@adhpawal
Created January 12, 2016 16:21
Show Gist options
  • Save adhpawal/863866de14ff1f168b21 to your computer and use it in GitHub Desktop.
Save adhpawal/863866de14ff1f168b21 to your computer and use it in GitHub Desktop.
Wildfly Setup For Java Mail Session using SendGrid : Using JBOSS CLI
#Goto WildFly Home
cd $WILDFLY_HOME/bin
#Open JBOSS Command Line Tool
./jboss-cli.sh
#Define a outbound-socket-binding named “MyMailSMTP”
/socket-binding-group=standard-sockets/remote-destination-outbound-socket-binding=MyMailSMTP:add( \
host=smtp.sendgrid.net, \
port=465)
#Define a JavaMail session named “MyMail”
/subsystem=mail/mail-session=MyMail:add(jndi-name="java:jboss/mail/gmail", from="[email protected]", debug=true)
#Add a reference from “MyMail” to “MyMailSMTP”
/subsystem=mail/mail-session=MyMail/server=smtp:add( \
outbound-socket-binding-ref=MyMailSMTP, \
ssl=true, \
username=sendgrid_username, \
password=sendgrid_password)
#Reload Setting to reflect new changes
reload
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment