title: Google Script Invalid Assignment left-hand side
body: <p>Ok so I have this code. Sorry, I didn't know where the problem is so I pasted it all. It says: Invalid assignment left-hand side. (line 1, file "Code"). I know the problem cannot be on line one but have no idea where it is.</p>
  
  <pre><code>function send(sheet, email, row){
    var tmp = GmailApp.getAliases();
    var alias = tmp[0];
  
    var subject = "Thank you for signing up for "+ sheet.getSheetName()+ "!";
    var body = "Hello "+ sheet.getRange(row,3).getValue() + " " + sheet.getRange(row,4).getValue() + "," + '\n'+'\n';
    var temp = 2;
    var bool = "TRUE";
    while (bool == "TRUE"){
      if (sheet.getRange(temp,11).getValue() != ''){
        body += '\n' + sheet.getRange(temp,11);
        temp += 1;
      }
      if (sheet.getRange(temp + 1,11).getValue() != '')
        body += '\n' + body += '\n' + sheet.getRange(temp + 1,11);
      else {bool = "FALSE"}
    }
  
    Logger.log(body);
  
    if ( sheet.getRange('L2').getValue() != ""){
      var html = sheet.getRange('L2').getValue();  // Place HTML code here
      try {
        GmailApp.sendEmail(email, subject, body, {'from': alias, 'htmlbody': html});
        sheet.getRange(row, 9).setBackground("green");
        sheet.getRange(row, 9).setValue("Yes");
        sheet.getRange("J2").setValue(row - 2);
      } catch (e) {
        var me = Session.getActiveUser().getEmail();
        MailApp.sendEmail(me, "Autoreply error", "There was a problem sending an email to: " + email +".");
      }
    }
    else{
      try {
        GmailApp.sendEmail(email, subject, body, {'from': alias});
        sheet.getRange(row, 9).setBackground("green");
        sheet.getRange(row, 9).setValue("Yes");
        sheet.getRange("J2").setValue(row - 2);
      } catch (e) {
        MailApp.sendEmail(me, "Autoreply error", "There was a problem sending an email to: " + email +".");
      }
    }
  }
  
  function main(){
    var ss = SpreadsheetApp.openById("1a2xvZ6hx69hst0CoLnCc8V5Igi-V5_HaNm6GTpEU8B4"); // Unique ID for the 'Responses' spreadsheet
    var sheet = ss.getActiveSheet();
  
    if ( sheet.getRange('J2').getValue() == "" ){
      sheet.getRange('I1').setValue("Sent");  // Initialize labels
      sheet.getRange('J1').setValue("Count");
      sheet.getRange('K1').setValue("Email body");
      sheet.getRange('L1').setValue("HTML body");
      var row = 2;
    } else {
      var row = sheet.getRange("J2").getValue() + 2;
    }
    while ( (sheet.getRange(row,9).getValue() != '') &amp;&amp; (sheet.getRange(row,2).getValue() != '')) {
      var email = sheet.getRange(row, 2).getValue();
      send(sheet, email, row);
      row += 1;
    }
  }
  </code></pre>