Gmail app google app script catching failures

46 views
Skip to first unread message

William Zeni

unread,
Dec 24, 2022, 7:47:48 AM12/24/22
to Google Apps Script Community
Hi guys, 
I searched a lot for an answer but I didn't find anything yet, I hope you will provide me with some tips. 

I was wondering if there is a way to catch errors in sending email with GmailApp in google app script. In my case, I have a script that takes some mail addresses from a sheet and try to send some emails. Sometimes could happen that the recipient doesn't exist. Actually, the script sends the email and aftwer a while it sends me back a mail delivery failure. I can't figure it out if I can manage some Promise - await code to do somenthing else when the email doesn't exist. 

Any suggestions?  

Alex

unread,
Dec 29, 2022, 12:24:45 AM12/29/22
to Google Apps Script Community
Nope, you can't.

It's two services: a send service and a delivery report service.

You have to checking delivery reports checking to continue making decisions in the future, but not asynchronously. 

Reply all
Reply to author
Forward
0 new messages