Email 谷歌应用程序脚本:编辑单元格后如何发送邮件?

Email 谷歌应用程序脚本:编辑单元格后如何发送邮件?,email,google-apps-script,google-sheets,send,Email,Google Apps Script,Google Sheets,Send,我有一个空的谷歌电子表格和以下正在运行的应用程序脚本代码: // This function SUCCESSFULLY opens a message box whenever a cell is edited, it shows the row of the edited cell. function onEdit(e) { Browser.msgBox(e.range.getRow()); } // This function SUCCESSFULLY sends an email t

我有一个空的谷歌电子表格和以下正在运行的应用程序脚本代码

// This function SUCCESSFULLY opens a message box whenever a cell is edited, it shows the row of the edited cell.
function onEdit(e) {
  Browser.msgBox(e.range.getRow());
}

// This function SUCCESSFULLY sends an email to 'john@doe.com' (this email address is changed for an actual registered address) upon being called.
function myTestFunction() {
  MailApp.sendEmail('john@doe.com', 'Test', 'Cell changed');
}
但是,如果我将“onEdit”-函数更改为以下值,它将无法正常工作:

// This function SUCCESSFULLY opens a message box whenever a cell is edited, BUT IT DOES NOT SEND AN EMAIL.
function onEdit(e) {
  Browser.msgBox(e.range.getRow());
  MailApp.sendEmail('info@bpbl.de', 'Test', 'Cell changed');
}
为什么后一个“OneEdit”功能不发送电子邮件?


(是的,我已经检查了我的,还有很多。)

这个问题已经发布,不幸的是,你不能在简单的触发器OneEdit中调用sendEmail函数:(


这是否回答了您的问题?