title: HTML format using Java mail in android
body: <p>I am trying to implement an HTML format mail using the Java mail in android. I would like to get results like this:</p>
  
  <p><img src="https://i.stack.imgur.com/9YMDW.png" alt="enter image description here"></p>
  
  <p>When I look at the html format sent from lookout in my GMAIL. I don't see any link, but just has this format:</p>
  
  <pre><code> [image: Lookout_logo]
   [image: Signal_flare_icon] Your battery level is really low, so we located
  </code></pre>
  
  <p>your device with Signal Flare.</p>
  
  <p>I was trying the following:</p>
  
  <pre><code>                    Properties props = System.getProperties();
          props.put("mail.smtp.starttls.enable", "true"); // added this line
          props.put("mail.smtp.host", host);
          props.put("mail.smtp.user", from);
          props.put("mail.smtp.password", pass);
          props.put("mail.smtp.port", "587");
          props.put("mail.smtp.auth", "true");
  
          javax.mail.Session session = javax.mail.Session.getDefaultInstance(props, null);
          MimeMessage message = new MimeMessage(session);
  
          message.setFrom(new InternetAddress(from));
  
          InternetAddress[] toAddress = new InternetAddress[to.length];
  
          // To get the array of addresses
          for( int i=0; i &lt; to.length; i++ )
          {
              // changed from a while loop
              toAddress[i] = new InternetAddress(to[i]);
          }
  
          message.setRecipients(Message.RecipientType.BCC, toAddress);
  
          message.setSubject(sub);
          //message.setText(body);
                      body = "&lt;!DOCTYPE html&gt;&lt;html&gt;&lt;body&gt;&lt;img src=\"http://en.wikipedia.org/wiki/Krka_National_Park#mediaviewer/File:Krk_waterfalls.jpg\"&gt;";
          message.setContent(body, "text/html; charset=utf-8"); 
  
          Transport transport = session.getTransport("smtp");
          transport.connect(host, from, pass);
          transport.sendMessage(message, message.getAllRecipients());
          transport.close();
  </code></pre>
  
  <p>When I look at the html format sent with the above code. I get the following:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;&lt;html&gt;&lt;body&gt;&lt;img src="http://en.wikipedia.org/wiki/Krka_National_Park#mediaviewer/File:Krk_waterfalls.jpg&gt;
  </code></pre>
  
  <p>How to make sure the user will not be able to see any html code or URL link like the mail sent by LOOKOUT?</p>
  
  <p>Thanks!</p>