In my Google Script program, I incorporate MailApp in the following manner:
MailApp.sendEmail(AddressStringGlobal,EMailSubjectProperLanguageGlobal,"",{htmlBody: EMailBody});
The issue arises when I encounter a bad email address in my data set, causing my program to crash. For instance, if the 50th row out of 100 contains an incorrect email address, only 49 emails are successfully sent while 51 fail.
The specific error message that I encounter is as follows:
Invalid email: org (line 707, file, "code")
Although I haven't found any information in the MailApp documentation, I'm interested in knowing whether there's a way to detect failed emails within my code rather than having the entire program crash. I am open to using a different email service that offers this functionality or any other suggestions you might have.