title: JAVAMAIL + ERROR + Connection closed by remote host
body: <p>I'm trying to send mass emails, Achievement send 20 emails on average and then I get this error:</p>
  
  <p>javax.mail.MessagingException: Can't send command to SMTP host; nested exception is: java.net.SocketException: Connection closed by remote host </p>
  
  <p>CODE JAVA:</p>
  
  <pre><code>public void mandarEmail(String correos, String mensaje, String asunto) {
      final String username = "docs-gf@usmp.pe";
      final String password = "Docpass";
      Message message;
  
      Properties props = new Properties();
      props.put("mail.smtp.auth", "true");
      props.put("mail.smtp.starttls.enable", "true");
      props.put("mail.transport.protocol", "smtp");
      props.setProperty("mail.smtp.port", "587");
      props.put("mail.smtp.host", "pod51004.outlook.com");
  
      Session session = Session.getInstance(props, new javax.mail.Authenticator() {
          @Override
          protected PasswordAuthentication getPasswordAuthentication() {
              return new PasswordAuthentication(username, password);
          }
      });
      try {
          message = new MimeMessage(session);
          message.setFrom(new InternetAddress("Hello my friend"));
          message.setSubject("I love u very much");
          message.setRecipients(Message.RecipientType.TO, InternetAddress.parse("ivan@hotmail.com"));
          message.setContent(mensaje, "text/html; charset=utf-8");
          Transport.send(message);
      } catch (MessagingException e) {
          throw new RuntimeException(e);
      } finally {
          props = null;
          message = null;
      }
  }
  </code></pre>
  
  <p>I'm forgetting something?</p>