0

I have a script that is supposed to send an email but it will only work in certain circumstances.

The first snippet will send the mail; the second will finish without errors without sending it. In short, if I have the variables there it will not sent.

var schoolYear = "2017-2018"
var message = "Please see the attachment for the " + schoolYear + " SGA class election name confirmation sheet. Have a great day B!";
var subject = schoolYear + " SGA Class Election Name Confirmations"
var email = "austin.hoag@icloud.com"
var name = "FHS SGA Election Name Confirmation"
MailApp.sendEmail(email, "subject", "message", {name: name});

var schoolYear = "2017-2018"
var email = "austin.hoag@icloud.com"
var name = "FHS SGA Election Name Confirmation"
var message = "Please see the attachment for the " + schoolYear + " SGA class election name confirmation sheet. Have a great day B!";
var subject = schoolYear + " SGA Class Election Name Confirmations"
MailApp.sendEmail(email, subject, message, {name: name});
VMAtm
  • 27,943
  • 17
  • 79
  • 125
Austin Hoag
  • 151
  • 1
  • 1
  • 4
  • I had originally miss diagnosed the problem. After rediagnosing the problem I have found a answer in http://stackoverflow.com/questions/17355823/mailapp-sendemail-not-working – Austin Hoag Apr 07 '17 at 18:31
  • Possible duplicate of [MailApp.sendEmail Not Working?](http://stackoverflow.com/questions/17355823/mailapp-sendemail-not-working) – Liam Apr 10 '17 at 15:14

0 Answers0