You can't really setup JMS Queues to be directly used by an SMTP server. What you can do is
- Setup a JMS Queue in your server
- Create a JMS Producer, which when invoked, should receive the email data (subject, body, to , cc etc) and post it to the Queue setup in step 1
- Create a JMS Consumer, which subscribes to the Queue created in Step 1, and its onMessage should call the JavaMail API to send the email.
Why do all these? So that the JavaMail call is asynchronous.
manpreet
Best Answer
2 years ago
I know the concept of Message Driven Beans within the EJB/Spring Framework. I know how to send e-mails using the Java Mail API and I know the JMS Architecture in terms of the 2 protocols:
I have to use JMS as the technology to process e-mails. Java Spring provides Message Driven Beans support and JMS support. My question is how can I configure JMS Queues for an SMTP Server? I cannot find anything online about this, but people have done it.
So what I would like to do is, the message queue would listen for e-mails coming in and when an e-mail comes in then it does some processing. I know I have to use Message Driven Beans but the question is how can I configure JMS with the connection to an SMTP Server.
Any help would be appreciated. It would be great if you could include some examples. I have tried looking on Google but nothing shows up.