You may be trying to send an email when a cell value is updated in Google Sheet. But the OnEdit() trigger does not send the email no matter what you try. Why so? Here is the solution.
See a complete tutorial here: How to send email when cell value changes in Google Sheets
Simple trigger can’t send email
If you simply added onEdit to your script and tried sending email from there, it can’t work. Google sheets blocks emails from simple triggers.
Install a trigger
The alternative is to install a trigger.
Then go to the menu item: Edit → Current Project’s triggers
Then click on the button “Add trigger” (the button is in the lower right corner)
For “Choose Which function to run” select your function to call.
for “event source” select spreadsheet
for “event type” select “OnEdit”
Press the “save” button and then provide the approvals that it asks.
Now try sending your email from the trigger function.
See a complete example here:
How to send email when cell value changes in Google Sheets
How to send email from Google Sheets