Is your function sendAlert()
called from an onEdit()
function?
The simple onEdit function is unable to send mails, as is described in the documentation. Therefore, use an installable onEdit trigger instead. This last one will ask for authorization and then execute as expected.
The triggers are in the ressource tab in the script editor, it looks like this:
Note: If you are re-using an existing onEdit()
function, remember to rename it so it will no longer act as a simple trigger function.