Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

290
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda