Q:

Google script spreadsheet, email sending row based

I am trying to make a script that would make a spreadsheet, sending an email if  expiry date is less than today but for each row by itself.
So I have a spreadsheet that has an expiry date, and email for each supplier and I want to send a reminder for the supplier email if the expiry date is less than today. 
Each row of the spreadsheet contain information about a supplier and the script should check for the expiry date compare with today and it less than then send an email to the supplier email which exists in a cell.
I tried to do for loop and such but failed.

A:

If you have this kind of table in a Spreadsheet:
name           | email          | date
--------------------------------------------
Mario Rossi    | mario@test.com | 2018/03/08
Luigi Bianchi  | luigi@test.com | 2018/02/25
Giuseppe Verdi | giuse@test.com | 2018/09/01

You can create a bound script in Google Apps Script like this:
function myFunction() {
  var today = new Date();
  var values = SpreadsheetApp.getActiveSheet().getDataRange().getValues();
  for(n=1;n<values.length;++n){
    var cell_date = values[n][2];
    var expired = today > cell_date;
    if (expired) {
        //MailApp.sendEmail(values[n][1], subject, message);
        Logger.log('send mail to ' + values[n][1]);
    }
  }
}

Schedule the script to run one time every day at specific time.
Assuming that today is the 2018/03/30 the result is:
send mail to mario@test.com
send mail to luigi@test.com

