title: Google Script for sending mass emails from Sheets stopped working. I didn't change the code
body: <p>I have found a script that worked for sending batch emails straight from Google Sheets. I used it occasionally and it worked great. And then it just stopped working. When I run the code below, I see the message &quot;Execution completed&quot;, but the emails don't arrive.</p>
  <p>I can read basic code and that's about the extent of my knowledge. That is to say, that the only things I change in what you see below are the subject of the email, the number of rows to process and the parameters in getRange.</p>
  <p>I've tried to use the script on diffrent sheets, from different Google Accounts. No luck.</p>
  <p>I would be greatful for your help.</p>
  <p>Edit 1: I copied the code, made a new file and ran it there. It only sent an email to the address in row 4, even though the range was set to be from row 1 to 5. I am very confused now.</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>  //Прежде чем запускать, убедись, что ты сидишь с того аккаунта, с которого должны улететь письма!!!
  function sendEmails() {
    var sheet = SpreadsheetApp.getActiveSheet();
    var startRow = 1;  // First row of data to process
    var numRows = 5;   // Number of rows to process
    // Fetch the range of cells A1:B5
    var dataRange = sheet.getRange(startRow, 1, numRows, 5);
    // Fetch values for each row in the Range.
    var data = dataRange.getValues();
    for (i in data) {
      var row = data[i];
      var emailAddress = row[0];  // First column
      var message = row[1];       // Second column
      var subject = "Script Test 18/02";
      MailApp.sendEmail( emailAddress, subject, message);
    }
  }</code></pre>
  </div>
  </div>
  </p>