"email recipients per day" vs. "daily sending limit"

78 views
Skip to first unread message

Josh Vitow

unread,
Aug 2, 2019, 5:20:00 PM8/2/19
to Google Apps Script Community

A few months ago, I had an Upwork freelancer build me an google API that would auto respond to incoming business emails on gmail that included certain keywords in the subject line.  The program was set to run every 10 minutes so that my customers would get prompt replies (prompt replies are essential in my line of business).  It is generally working fine, but every so often I receive an email from google with one of the following four error messages. 

 

-Service invoked too many times for one day: gmail. (line 49, file "Code")

-TypeError: Cannot read property “length” from undefined. (line 34, file “Code”)

 

-getEmails

Message no longer valid. (line 49, file "Code")

-getEmails

TypeError: Cannot read property "length" from undefined. (line 34, file "Code")

time-based

 

I am not tech savvy at all, so I am like a deer in the headlights trying to figure out what the issues are.  The only error message I understand is “service invoked too many times for one day: gmail”

 

I use standard gmail, not G Suite.  I see that the “email recipients per day” is limited to 100.  I am trying to figure out if I have to upgrade to G Suite to solve the “service invoked too many times” error message.

 

In assessing this, I am wondering about a few things.

 

First, what is counted towards the 100 email tabulation? 

 

Only emails sent? 

All emails that are both sent and received? 

Are google calendar invites counted towards the number of “emails sent?”

Are google calendar acceptances or declinations from the party that I invited counted towards the number of “emails sent?”

 

Second, I cant even figure out how I went afoul of the rule, since it does not seem like I went over the 100 email limit on the occasions when I received the “service invoked too many times” error message.  As an example, on June 5, I received the error message.  But I counted only 28 emails received and 7 emails sent over the entire June 4 - June 5 period.  It is not entirely clear to me how the 24 hour period is calculated (does it start at 12am or at another time when the API was loaded into gmail?), so I think I was overly liberal in including more messages than a strict 24 hour period and still I wasn’t even close to the line.      

 

Third, I am left wondering what the category of "email recipients per day" means?  This is limited to 100 on gmail and 1,500 on G Suite.  https://developers.google.com/apps-script/guides/services/quotas

 

How is this different than the “daily sending limit” of 500 on gmail and 2,000 on G Suite? https://support.google.com/a/answer/166852

 

I spent hours reading through threads on stackoverflow yesterday and there seems to be mass confusion about google sending limits since the rules are written in chart form, in short-hand that lends itself to multiple interpretations and with no long-form, prose explanations to follow.  


Also, any idea what the other 3 error messages are about in plain English?  Is there a way to fix the API code so that I don’t get these error messages anymore? 

 

I can share the google sheet that has the API code if anyone needs to examine it.


I sent this question directly to someone who works at google who I found through github and his response was "The short version is that Apps Script has lots of additional internal quotas besides those listed in the documentation, and you are running afoul of it. There is nothing you can do except reduce the frequency of your script."


This response confused me even more.  What is the frequency limitation?  Is this a reference to "triggers total run time?"  If yes, how do I tabulate how many minutes my tigger is running for?  Most days the script works fine, so if I was running the script too frequently wouldnt it run afoul of the rules every day? 


Go easy on me guys.  I am a computer simpleton.  


Dimu Designs

unread,
Aug 2, 2019, 6:30:38 PM8/2/19
to Google Apps Script Community
Please share your sheet so that we can review it.

Josh Vitow

unread,
Aug 2, 2019, 6:53:09 PM8/2/19
to Google Apps Script Community
Happy to do so, but how do I share the sheet?  I assume you want me to copy and paste the back-end code?  How would I access that? I know this sounds terribly ignorant...

Andrew Roberts

unread,
Aug 3, 2019, 5:10:24 AM8/3/19
to Google Apps Script Community
To share the script: Assuming this is a stand-alone script (it's not bound to a particular spreadsheet), open up the script and click on the blue "Share" button in the top right hand corner. Then click on the "Copy link" button to get a copy of the link to the - now shared - script and paste it on here.


Saying that there are lots of "GMail AutoResponders" out there. One of those might be a bit more reliable.

Josh Vitow

unread,
Aug 3, 2019, 2:03:14 PM8/3/19
to Google Apps Script Community
Andrew, thanks for your kind reply.  

I am attaching a photo of the way the script was delivered to me by the freelancer who wrote it for me.  I assume that it is indeed bound to "a particular spreadsheet" as opposed to being a "stand-alone script."  Is this correct?

I clicked on the green "share" button in the top right corner of the spreadsheet to generate a link to paste here, but when the pop up box appeared, I realized that the link was going to give everyone with the link the right to edit the spreadsheet (which I assume would be a poor idea) (photo 2 below). 

So I clicked on the drop down box to modify the permissions to "Anyone with the link can view." (photo 3 below).  But once selecting this option, Google supplied a very odd message which is " By changing sharing settings, you will no longer be able to edit this file."  (photo 4 below).  

Does this mean that I am forever foreclosing the possibility of editing the code?  Why would google hamstring me this just because I want to limit permission to those viewing to view and not edit?  I want to maintain the ability to edit the spreadsheet to add or delete keywords that trigger the autoresponse.  Also, if the code has to be modified so that I dont get the error messages that prompted me to post in the first place, I assume I want to maintain the ability to edit.  How do you suggest I get the code to you guys?  
  

spreadsheet.jpg

spreadsheet2.jpg


spreadsheet3.jpg

spreadsheet4.jpg

Andrew Roberts

unread,
Aug 4, 2019, 6:39:15 AM8/4/19
to google-apps-sc...@googlegroups.com
If you click on the "Advanced" button in the pop-up just check that you are the owner. If that is the case you won't be able to lose access to your own file without transferring ownership.

I'm guessing that Alexandr is the dev, in which case that implies you are the owner of the sheet.

If  you tick the "anyone can view" box we'll be able to see the script but not change anything.



--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/589b93e5-fbcf-4b9f-b92c-5d9892399429%40googlegroups.com.

Dimu Designs

unread,
Aug 4, 2019, 7:02:49 AM8/4/19
to google-apps-sc...@googlegroups.com
I was able to open the sheet by pulling the following URL from the screenshot:

https://docs.google.com/spreadsheets/d/1Te9Bu_NLHpwYWrnGVls06fvwZYLAqI6kDLRhELLaoow/edit#gid=0

The file is owned by "Alexandr Samokhin" who I assume is the developer. His contact info (alexs...@gmail.com) is as the top of the script so OP may want to consider contacting him to troubleshoot his issues.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-community+unsub...@googlegroups.com.

Andrew Roberts

unread,
Aug 5, 2019, 3:17:49 AM8/5/19
to google-apps-sc...@googlegroups.com
Josh, As DD points out the script is still owned by the dev, Alexandr, which means you could lose access quite easily. So the first thing to do is to take your own copy of the sheet  (File > Make a copy) so you have a copy you own. And I see you can manage the triggers from the menu on either copy.

Re. the timeouts, you can try tweaking that "Interval" seting to reduce the frequency of the emails sent.

On Sun, 4 Aug 2019 at 12:02, Dimu Designs <dimud...@gmail.com> wrote:
I was able to open the sheet by pulling the following URL from the screenshot:

https://docs.google.com/spreadsheets/d/1Te9Bu_NLHpwYWrnGVls06fvwZYLAqI6kDLRhELLaoow/edit#gid=0

The file is owned by "Alexandr Samokhin" who I assume is the developer. His contact info is as the top of the script so OP may want to consider contacting him to troubleshoot his issues.

I was able to open the script and
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/cf63e3e8-7eab-4270-b36e-7309afc58b5c%40googlegroups.com.

Josh Vitow

unread,
Aug 5, 2019, 11:26:19 PM8/5/19
to Google Apps Script Community
Alex Samokhin, the developer, disappeared once I paid him and has been unresponsive for months.  Typical Russian thug.    

Josh Vitow

unread,
Aug 5, 2019, 11:34:26 PM8/5/19
to Google Apps Script Community
I made a copy of the sheet and generated a link here so you guys can now view the code.  

https://docs.google.com/spreadsheets/d/1Q8_jlNSg7jZguXPWrujZMx7SCjAqLmGwAWIaX8b9IUI/edit?usp=sharing

Which of the four error messages I pasted into my original posting is "complaining" that the frequency threshold has been exceeded? 

Also, what is the frequency threshold and how do I calculate the total frequency with which my script is running?  I need it to run as often as possible because response speed is essential in my line of business.  If I dont response quickly, then I dont capture the business and it goes to a competitor.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-community+unsub...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-community+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages