title: send html page as email in java
body: <p>I am trying to send html page as message.
  already send html email through <code>message.setContent("&lt;html&gt;&lt;body&gt;&lt;h1&gt;This is actual message&lt;/h1&gt;&lt;/body&gt;&lt;/html&gt;","text/html" );</code> these method .Now iwant to send a html page .
  like  <code>message.setContent("street.html","text/html" );</code></p>
  
  <p>how to send these below is my full code</p>
  
  <pre><code>String to = "to@gmail.com";
    String from = "from@gmail.com";
    Properties properties = System.getProperties();
      properties.put("mail.smtp.starttls.enable", "true"); 
      properties.put("mail.smtp.host", "smtp.gmail.com");
      properties.put("mail.smtp.port", "587");
      properties.put("mail.smtp.auth", "true");
  
    Session session = Session.getInstance(properties, new javax.mail.Authenticator() {
  protected PasswordAuthentication getPasswordAuthentication() {
      return new PasswordAuthentication("from@gmail.com", "from2013");
  }});
  
    try{
       MimeMessage message = new MimeMessage(session);
       message.setFrom(new InternetAddress(from));
       message.addRecipient(Message.RecipientType.TO,new InternetAddress(to));
       message.setSubject("This is the Subject Line!");
       message.setContent("street.html","text/html" );
       Transport.send(message);
       System.out.println("Sent message successfully....");
    }catch (MessagingException mex) {
       mex.printStackTrace();
    }
  </code></pre>