Gmail operation not allowed.

1,948 views
Skip to first unread message

fran diklic

unread,
Mar 7, 2024, 10:08:58 AM3/7/24
to Google Apps Script Community
I'm working on a script that uses the Gmail API to send email (HTML body) to a list of users via GmailApp.sendEmail() function. After it sends email to 5 users, I get the "Gmail operation not allowed." exception.

I'm not sure if there is something wrong with my script (limits, permissions, ...), or is it something wrong with the Gmail API. I've tried to google for an answer but all I find is that it happens from time to time, which isn't very insightful.

Can someone please explain what this exception means and how to handle it?

Thank you in advance for your assistance!

George Ghanem

unread,
Mar 8, 2024, 10:16:30 PM3/8/24
to google-apps-sc...@googlegroups.com
Hi Fran,

Is this a workspace account of a free Gmail account?

There is a cap of 50 recipients per day for the free tier of Gmail users. Depending on how many times you ran the script, you may gave bumped into it.  

Workspace accounts also have caps but with a higher count.

--
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/1dbe6714-6839-43f8-bbab-b234fb64f14bn%40googlegroups.com.

Edward Wu

unread,
Mar 11, 2024, 12:52:51 PM3/11/24
to google-apps-sc...@googlegroups.com
You can also use MailApp.getRemainingDailyQuota() to see how much of your quota you've used up for the day: https://developers.google.com/apps-script/reference/mail/mail-app#getRemainingDailyQuota()


Reply all
Reply to author
Forward
0 new messages