title: i want to send mail using java with out delaying
body: <p>I am using javaMail API for Sending mails my code is working fine but the Problem is that while sending mail it is taking  time to send mails(delaying time is nearly 15 to 20 seconds), this is the reason my application is going down.I want to send mails with out taking any time while sending mails .Please give an idea </p>
  
  <p>here is my code:</p>
  
  <pre><code>public class sendMail {
  
  public static void main(String[] args) {
      Properties props = new Properties();
      props=System.getProperties();
      props.put("mail.smtp.host", "smtp.gmail.com");
      props.put("mail.smtp.socketFactory.port", "465");
      props.put("mail.smtp.socketFactory.class","javax.net.ssl.SSLSocketFactory");
      props.put("mail.smtp.auth", "true");
      props.put("mail.smtp.port", "587");
  
      String mail="XYZ@gmail.com";
  
  
      Session session = Session.getDefaultInstance(props,
          new javax.mail.Authenticator() {
              protected PasswordAuthentication getPasswordAuthentication() {
                  return new PasswordAuthentication("abc@gmail.com","********");
              }
          });
  
      try {
      String emails="xyz@gmail.com"+","+"xyz.kannoju@vxyz.com";
          Message message = new MimeMessage(session);
          message.setFrom(new InternetAddress("xyz.rajender@gmail.com"));
          message.setRecipients(Message.RecipientType.TO,
                  InternetAddress.parse(emails));
          message.setSubject("Testing Subject");
          message.setText("Dear Rejender," +
                  "\n\n Please find the like!");
  
      //Transport.send(message);
          Transport tr=session.getTransport("smtp");
          //tr.sendMessage(message, message.getRecipients(message.));
          tr.send(message);
          tr.close();
  //Transport         
  
          System.out.println("Done");
  
      } catch (MessagingException e) {
          throw new RuntimeException(e);
      }
  }
  </code></pre>