I did a project on google apps scripts to send automatic emails after a form response was sent. However, when I check the daily quota of remaining emails with the MailApp.getRemainingDailyQuota()
method, the quota responses vary with each script execution.
So I created another project just to test the quota, using the MailApp.getRemainingDailyQuota()
method and even so, the quota response varied with each execution.
Code used to test:
function testeDeCota() {
let cota;
cota = MailApp.getRemainingDailyQuota();
Logger.log("Cota de emails restantes: " + cota);
cota = MailApp.getRemainingDailyQuota();
Logger.log("Cota de emails restantes: " + cota);
}
I am using a workspace account that has a quota of 1500 emails/day.
This is a screeshot of my executions. Note that there are 3 consecutive executions and without sending any email, even so the quota responses varied. The responses were:
1394;
1399;
1390.
Whenever I try to send an email or get the quota information the number just varies randomly.
printscreen of the script executions
question from:
https://stackoverflow.com/questions/65925982/how-do-i-get-the-remaining-daily-mail-quota-of-google-apps-scripts-service-to-wo 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…