public void sendEmails() { Thread last = new Thread(); setupTemplate(); for(String email: emails) { last = new EmailMailer(session,from,email,subject,body,mime).thread(); last.start(); } try { last.join(); } catch (InterruptedException e) { e.printStackTrace(); } }