Same topic has been posted on StackOverFlow. Need inputs from fellow Code Ranchers too.
http://stackoverflow.com/questions/25545226/javamail-code-suggestions
I am writing a Bean which can send same message to multiple user or can send different message to same user. My application is REST based and an email needs to be triggered when a service is hit.Application can send any number of emails in a day. I have written below class for the same.Any improvements that I can do in below code. I fetch values for properties like from ,host,etc from my Db.I am querying the Db only once and populating javax.mail. Session object with the same.