I've got an empty Google Spreadsheet and the following working Apps Script code:
// 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');
}
However, if I change the 'onEdit'-function to the following it doesn't work properly:
// 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');
}
Why does the latter 'onEdit'-function NOT send an email?
(Yes, I have checked my remaining daily email quota, there is plenty left.)