Created
January 12, 2016 16:21
-
-
Save adhpawal/863866de14ff1f168b21 to your computer and use it in GitHub Desktop.
Wildfly Setup For Java Mail Session using SendGrid : Using JBOSS CLI
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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