title: Send reminder emails based on date
body: <p>I'm using the following script to send email reminders from a Google Sheet, but would like to modify it so that it send the email out on a date specified in cell F of each row.</p>
  
  <pre class="lang-js prettyprint-override"><code>var EMAIL_SENT = "EMAIL_SENT";
  
  function sendEmails2() {
    var sheet = SpreadsheetApp.getActiveSheet();
    var startRow = 2;  // First row of data to process
    var numRows = 999;   // Number of rows to process
    // Fetch the range of cells A2:B999
    var dataRange = sheet.getRange(startRow, 1, numRows, 999)
    // Fetch values for each row in the Range.
    var data = dataRange.getValues();
    for (var i = 0; i &lt; data.length; ++i) {
      var row = data[i];
      var emailAddress = row[0];  // First column
      var subject = row[1];     // Second column
      var message = row[2];    // Third column
      var emailSent = row[3];     
  
      if (emailSent != EMAIL_SENT) {  // Prevents sending duplicates
  
        MailApp.sendEmail(emailAddress, subject, message);
        sheet.getRange(startRow + i, 4).setValue(EMAIL_SENT);
        // Make sure the cell is updated right away in case the script is interrupted
        SpreadsheetApp.flush();
      }
    }
  }
  </code></pre>
  
  <p>That's what I have and any attempts to add a date in there have failed pretty badly.</p>
  
  <p>I came across this earlier question: <a href="https://stackoverflow.com/questions/11025491/google-apps-script-send-email-based-on-date-in-cell">Google Apps Script - Send Email based on date in cell</a> but was unable to combine it with my script.</p>