1

我正在尝试在应用脚本中捕获电子邮件传递失败。我认为在 try catch 中围绕 MailApp.sendEmail 会像这样工作:

function headache(){
 Logger.log("Before Try");
  try{
    Logger.log("before sendEmail");
    MailApp.sendEmail("ThisAFake@email.address", "Ima Error", "");
    Logger.log("after sendEmail");
  }catch(err){
   Logger.log("In catch");
    MailApp.sendEmail("ThisAReal@email.address", "Ima catched Error", "");
    } 
  Logger.log("After Try");
}

但这是我得到的输出:

Before Try
before sendEmail
after sendEmail
After Try

有没有办法捕捉邮件发送失败?

4

1 回答 1

4

电子邮件发送被推迟,没有办法捕捉到这个错误。

于 2013-03-11T22:06:51.260 回答