MailApp.sendEmail doesn"t work

OK, your global url has the spreadsheet details. You appear to be missing a & before the 1SH=

image

You do not appear to be switching screens correctly, this can lead to memory issues and app crashes.