Skip to content

pedroviniv/ejb-mail-sender

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ejb-mail-sender

Before build and deploy the project you should create a few resources on your server.

I'm using the resources below:

  • javax.jms.ConnectionFactory "jms/dac/dacConnectionFactory"
  • javax.jms.Queue named "jms/dac/newEmailsQueue"
  • javax.jms.Queue named "jms/dac/waitingEmailsQueue"
  • javax.mail.Session "javamail/javaMailSession"

To create these on your glassfish/payara server you must open your terminal and put the following commands:

  • To create javax.jms.ConnectionFactory "jms/dac/dacConnectionFactory":

    • asadmin create-jms-resource --restype javax.jms.ConnectionFactory jms/dac/dacConnectionFactory
  • To create javax.jms.Queue named "jms/dac/newEmailsQueue":

    • asadmin create-jms-resource --restype javax.jms.Queue jms/dac/newEmailsQueue
  • To create javax.jms.Queue named "jms/dac/waitingEmailsQueue":

    • asadmin create-jms-resource --restype javax.jms.Queue jms/dac/waitingEmailsQueue
  • To create javax.mail.Session "javamail/javaMailSession":

    • asadmin create-javamail-resource --mailhost="smtp.gmail.com" --mailuser="GMAIL_USER" --fromaddress="GMAIL_ADDRESS" --debug="false" --enabled="true" --description="A new JavaMail Session!" --property="mail.smtp.password=GMAIL_PASSWORD:mail.smtp.auth=true:mail.smtp.port=465:mail.smtp.socketFactory.fallback=false:mail.smtp.socketFactory.port=465:mail.smtp.socketFactory.class=javax.net.ssl.SSLSocketFactory" "javamail/javaMailSession"

Building

To build the application just...

  • download as a zip file or clone this repository by running git clone https://github.com/pedroviniv/ejb-mail-sender.git
  • run mvn clean install

About

📧 An Email Sender using EJB, JMS and JavaMail

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published