nirmalkumarv
4/16/2017 - 11:18 AM

sendDailyNewsToKindle.js

function sendDailyNewsToKindle() {
  
var todayDate=Utilities.formatDate(new Date(), Session.getScriptTimeZone(), "dd.MM.YY");
var url="http://anynewsite.com/{dt}";
var urlPick=url.replace("{dt}",todayDate);
var response = UrlFetchApp.fetch(urlPick , {});
    
var todayDateN=Utilities.formatDate(new Date(), Session.getScriptTimeZone(), "dd.MMM.YYYY");
//convert the response to a blob and store in our array
var file1 = response.getBlob().setName(todayDateN + "News.pdf");

var subject="convert";
var body="Murli Content";
var email="<uniqueKindleMailId>@kindle.com";
if (MailApp.getRemainingDailyQuota() > 0) 
GmailApp.sendEmail(email, subject, body, {
  htmlBody: body,
  attachments:[file1]     
});  

  
}