java - Quartz job to send email using Javamail, but Javamail is synchronous -


the title sums issue @ moment. if have multiple instances of job running at/around same time, javamail throws exception it's meant used synchronously. there way can make run asynchronously? or there alternative javamail asynchronous?

i think there several ways deal such kind of tasks:

  1. wrap service periodically send batch of emails;
  2. send each email in on thread, i.e. imply separate smtp connection;

    @async public void sendemail(string smtpserver, string to,string from,string subject, string body) {       send(smtpserver, to, from, subject, body); } 

Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

javascript - jQuery UI Splitter/Resizable for unlimited amount of columns -

javascript - IE9 error '$'is not defined -