title: Embed html table tag in email intent android
body: <p>I am working on a concept in which I have to embed <strong>html table tag</strong> in email body.I tried some work around code it's working fine in <strong>2.2 and 2.3</strong> OS versions but the same code is not working in latest  OS versions like 4.0 etc.</p>
  
  <p>I also tried <code>Spannable and Html.fromHtml()</code>but it's also not working.</p>
  
  <p>Here is my code which is working on 2.2 and 2.3 OS versions:</p>
  
  <pre><code>//SEND EMAIL
      private void sendEmail(String imageUri) throws WriterException{
          //....................Prepare share email data............................. 
          int itemNumber=0;
          titleBuffer=new StringBuffer();
  
          titleBuffer.append("&lt;html&gt;&lt;body&gt;&lt;table border="+"1"+"&gt;&lt;tr border="+"0"+"&gt;&lt;th&gt;Item number&lt;/th&gt;"+
                  "&lt;th&gt;Barcode&lt;/th&gt;"+"&lt;th&gt;Product name&lt;/th&gt;"+"&lt;th&gt;Quantity&lt;/th&gt;&lt;/tr&gt;");
          for(int i=0;i&lt;_productList.size();i++){
              itemNumber=i+1;
              titleBuffer.append("&lt;tr border="+"0"+"&gt;&lt;td&gt;"+itemNumber+"&lt;/td&gt;"+
                      "&lt;td&gt;"+_productList.get(i).getProductBarcode()+"&lt;/td&gt;"+"&lt;td&gt;"+_productList.get(i).getProductName()+"&lt;/td&gt;"+
                      "&lt;td&gt;"+_productList.get(i).getProductQuantity()+"&lt;/td&gt;&lt;/tr&gt;");
  
              /*titleBuffer.append("&lt;tr border="+"0"+"&gt;&lt;td&gt;"+itemNumber+"&lt;/td&gt;"+
                      "&lt;td&gt;"+_productList.get(i).getProductBarcode()+"&lt;/td&gt;"+"&lt;td&gt;"+_productList.get(i).getProductName()+"&lt;/td&gt;"+
                      "&lt;td&gt;"+_productList.get(i).getProductQuantity()+"&lt;/td&gt;"+"&lt;td&gt;"+
                      "&lt;img src="+"/'data:image/png;base64, "+generateBarcodeImage(GenerateBarcode.encodeAsBitmap(_productList.get(i).getProductBarcode(), 
                              BarcodeFormat.CODE_128, 600, 300))+"/'/&gt;&lt;/td&gt;&lt;/tr&gt;");*/
          }
  
          titleBuffer.append("&lt;/table&gt;&lt;/body&gt;&lt;/html&gt;");
  
          SpannedString bar = new SpannedString(titleBuffer.toString());
  
          if(_productList.size()==0){
              titleBuffer.append("NA");
          }
          //..........................................................................
  
          Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
          emailIntent.setType("text/html");
          emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL,"");
          emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Shopping List");
          emailIntent.putExtra(android.content.Intent.EXTRA_TEXT,titleBuffer.toString());
          emailIntent.putExtra(Intent.EXTRA_STREAM, emailImageUri);
          startActivity(Intent.createChooser(emailIntent, "Send mail..."));
      }
  </code></pre>
  
  <p>Also find the attached image which proves it worked in 2.2 and 2.3 OS versions.</p>
  
  <p><img src="https://i.stack.imgur.com/L5eGB.png" alt="enter image description here"></p>