title: Send cucumber 'index.html' report to email
body: <p>I have created a testing automation framework using cucumber+appium.
  But after executing the framework i want to send the report (/target/cucumber/index.html) over email as mail body, but unable to do the same.
  The same thing i did with 'testng emailable-reports.html' and it works like charm.
  I tried with:-
  1. Jenkins using 'extended email plugin' for selenium .html report it works fine but for cucumber it is not working.
  2. using java mail api (jsoup library).</p>
  
  <p>Also as i right click on cucumber index.html report then it shows below code:-</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
    &lt;head&gt;
      &lt;meta charset="utf-8"&gt;
      &lt;title&gt;Cucumber Features&lt;/title&gt;
      &lt;link href="style.css" rel="stylesheet"&gt;
      &lt;script src="jquery-1.8.2.min.js"&gt;&lt;/script&gt;
      &lt;script src="formatter.js"&gt;&lt;/script&gt;
      &lt;script src="report.js"&gt;&lt;/script&gt;
    &lt;/head&gt;
    &lt;body&gt;
      &lt;div class="cucumber-report"&gt;&lt;/div&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>when i tried with java mail api, firstly i extract html and then tried to send the html but it send blank report.
  Please help how i can send the full html report as email body, also this reports contains attached 'screenshots', attached is the structure of /target/cucumber/ folder:-
  <a href="https://i.stack.imgur.com/LYb6Y.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LYb6Y.png" alt="enter image description here"></a></p>
  
  <p>Please help!!</p>
  
  <p>email send code:-</p>
  
  <pre><code>public class Email {
  
  
      public static void main(String[] args) throws IOException, SendGridException {
  
          FileInputStream fin=new FileInputStream(System.getProperty("user.dir")+"/src/main/resources/config.properties");
          Properties prop=new Properties();
          prop.load(fin);         
  
  
  
          StringBuilder path = new StringBuilder(); 
  
          try     
          { BufferedReader in = new BufferedReader(new FileReader(System.getProperty("user.dir")+prop.getProperty("reports"))); 
          String str; while ((str = in.readLine()) != null) 
          { path.append(str); } in.close(); } catch (IOException e) { } String content = path.toString();
  
          System.out.println("HTML IS :---" +path);
  
  
  
          SendGrid sendGrid = new SendGrid("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
          SendGrid.Email email = new SendGrid.Email();
  
          try {
              String[] toList ={"suresh.s@gmail.in","suresh98714@gmail.com"};
              email.addTo(toList);
          } catch (Exception e) {
  
              String emailTo = "suresh98714@gmail.com";
  
              email.addTo(emailTo);
          }
  
          email.setFrom("suresh98714@gmail.com");
  
  
          try {
              SMTPAPI smtpapi = email.getSMTPAPI();
  
              String[] cc ={"suresh.s@cashify.in","suresh98714@gmail.com"};
              email.setCc(cc);
          } catch (Exception e) {
  
          }
          try {// for bcc
              String[] bcc = {"",""};
              email.setBcc(bcc);
          } catch (Exception e) {
  
          }
  
  
          email.setSubject("Cucumber Report");
          email.setHtml(path.toString());
  
          SendGrid.Response response =sendGrid.send(email);
          System.out.println("Response is " +response.toString());    
  
  
  
  
      }
  </code></pre>
  
  <p>Expected email over email body (attached screenshot):-
  <a href="https://i.stack.imgur.com/LYb6Y.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LYb6Y.png" alt="enter image description here"></a></p>