Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

292
Views
Why did my DailyQuota for Gmail go down by 15 when i only sent 3 emails using appscript MailApp?

I'm sending emails using google appscript I had 1500 DailyQuata before I executed my code once which send 3 emails, but my Daily quota becomes 1485 afterward. as I sent 3 emails it should have only gone down by 3

Daily Quota limit showing 1485

My spreadsheet is as follows google Spreedsheet

entire code

function onOpen() {
  var ui = SpreadsheetApp.getUi();
  ui.createMenu('Automation')
    .addItem('send PDF Form', 'sendPDFForm')
    .addItem('send to all', 'sendFormToAll')
    .addToUi();
  console.log(MailApp.getRemainingDailyQuota())
}

function sendPDFForm() {
  var row = SpreadsheetApp.getActiveSheet().getActiveCell().getRow();
  sendEmailWithAttachment(row);
}

function sendEmailWithAttachment(row) {
  var client = getClientInfo(row);
  var file = DriveApp.getFilesByName(client.filename);
  if (!file.hasNext()) {
    console.error("Could not open file " + client.filename);
    return;
  }
  var template = HtmlService.createTemplateFromFile('email-template');
  template.client = client;
  var message = template.evaluate().getContent();
  MailApp.sendEmail({
    to: client.email,
    subject: "Engineer's Day participation Certificate",
    htmlBody: message,
    attachments: [file.next().getAs(MimeType.JPEG)]
  });

}

function getClientInfo(row) {
  var sheet = SpreadsheetApp.getActive().getSheetByName('Sheet1');
  var values = sheet.getRange(row, 1, 1, 5).getValues();
  var rec = values[0];
  console.log(rec)
  var client ={filename: rec[4],name: rec[1],first_name: rec[2],email: rec[3]};
  return client;
}

function sendFormToAll() {
  var sheet = SpreadsheetApp.getActive().getSheetByName('Sheet1');
  var last_row = sheet.getDataRange().getLastRow();
  console.log(last_row)
  for (var row = 2; row <= last_row; row++) {
    sendEmailWithAttachment(row);  //sending email
    Utilities.sleep(300);
    sheet.getRange(row, 7).setValue("email sent");
  }
}

I have checked the value of last_row it 4 so the loop runs only 3 times.

edit: I used sendFormToAll() function to send emails

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

As indicated in this post How do I get the remaining daily mail quota of google apps scripts service to work consistently?, and in many other Issue Tracker requests in the comments:

This is intended behavior.

It is an internal behavior in Apps Script and thus it is expected.

If somehow, this impacts your workflow, you could try checking your quota at least one hour after sending emails to stabilize the values.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!