admin管理员组

文章数量:1134247

I have a Google Business Starter account. My email limit is 1,500 per day but I'm getting the error code "Exception: Service invoked too many times for one day: email." after I send out 100 emails. I'm curious if there is something wrong with my Apps Script code or if I doing it incorrectly?

function email() {

  //Columns from email sheet
  var fn = 1;
  var email = 2;
  var cc1 = 3;
  var cc2 = 4;
  var submit = 5;
  var subject = '';

  var emailTemp = HtmlService.createTemplateFromFile("email class");

  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var sheet = ss.getSheetByName('Signup');
  var rowsWithData = sheet.getRange("A2:A").getValues().filter(String).length + 1;
  var data = sheet.getRange("A2:F" + rowsWithData).getValues();
 
  //Filters the names and emails of people who need a reminder
  data = data.filter(function (r) { return r[submit] == "" });
  
  subject = 'Please opt in or out'
  week = 'Ten'
  deadline = 'Friday'

  data.forEach(function (row) {

    emailTemp.fn = row[fn];

    var htmlMessage = emailTemp.evaluate().getContent();
    GmailApp.sendEmail(
      row[email] + "," + row[cc1] + "," + row[cc2],
      subject,
      "Your email doesn't support HTML.",
      { name: "****", htmlBody: htmlMessage, 'from': aliases[0] }
    );
  });


}

本文标签: google apps scriptWhy am I hitting email limit with mail mergeStack Overflow