Reputation: 1
I'm working on a Google Apps Script project that sends an email when a button is clicked on a HTML sidepanel I've built. Currently the script works as planned and fires off an email when told, but I'm wondering if there's any way that it could check that the email sent correctly so I can notify the user that it's ok to close the tab?
Thanks in advance
Upvotes: 0
Views: 2655
Reputation: 11278
If you are using the Gmail API to sending email, it will return the ID of the email that you can use to trace the email in your mailbox.
Google Script stores a copy of every sent email in the Gmail sent items folder. If you are using the GmailApp service, search the sent items for a copy of the email. If found, it was sent.
GmailApp.search("in:sent to:[email protected] after:epoch_time")
You can use epoch time in Gmail search to find emails that were sent in the last minute or so.
Upvotes: 1