title: How to display data URI image in email generated by Google App Script?
body: <p>How to display data URI image in email generated by Google App Script?</p>
  
  <pre><code>var recipient = Session.getActiveUser().getEmail();
  var subject = 'SP500 chart';
  
  var page = UrlFetchApp.fetch('http://www.barchart.com/chart.php?sym=%24SPX&amp;style=technical&amp;template=&amp;p=MO&amp;d=M&amp;sd=&amp;ed=&amp;size=M&amp;log=0&amp;t=CANDLE&amp;v=0&amp;g=1&amp;evnt=1&amp;late=1&amp;o1=&amp;o2=&amp;o3=&amp;sh=100&amp;indicators=&amp;addindicator=&amp;submitted=1&amp;fpage=&amp;txtDate=#jump').getContentText();
  var tag_begin = page.indexOf('data:image');
  var tag_end = page.indexOf('&gt;', tag_begin);
  var content = page.substring(tag_begin, tag_end);
  
  MailApp.sendEmail(recipient, subject, '', {'htmlBody': content});
  </code></pre>