We are using the Gmail API + mailR (https://www.rdocumentation.org/packages/mailR/versions/0.8) to send out emails in bulk. A few of our messages are returning an automated “Message Rejected” email from Google in short and succinct fashion which makes it seem like a pattern. Our approach is iterative, but we are not sure how those are handled internally after the send message function is called. We adjusted our implementation to account for Google rate limits.
Is this something anyone else has encountered? We’re wondering if it’s a synchronicity issue and adding a sleep interval would stop the issue, or if there’s something else at play; and as sleep intervals would exponentially increase runtime, we were hoping to resolve any ambiguity before trying it.
Hi @mhschafer,
Welcome to the Google Cloud community!
Just to set some expectations, issues specific to GMail API may not be my current scope of expertise in this forum, though I'd still like to provide my insights as best as I can.
While your code could be working as intended when sending out emails in bulk, Google Mail returns an automated "Message Rejected" due to a couple of reasons.
First, verify if you are aware of GMail sending limits. GMail imposed certain limits to prevent overuse of resources such as number of Gmail messages users can send per day, the total number of recipients per day, and other rate limits which usually get refreshed after 24 hours.
Another possibility to explore here may be related to the certain recipients of your email. Since you said that there seems to be a pattern observed in each attempt, it could be that certain emails no longer exist or they are configured not to receive emails from your end. Other contributing factors for bounced or rejected emails have been covered in this documentation.
If the issue persists, this link may provide you the best places where you can request for additional help in getting this issue addressed related to GMail API. You can also reach out through the GMail Help Community where topics like this have a higher chance to be discussed and examined further.
Was this helpful? If so, please accept this answer as “Solution”. If you need additional assistance, reply here within 2 business days and I’ll be happy to help.