I want to send an email with an image instead of an attachment through the Google Sheets spreadsheet.
Here is my code (this code is used to send emails with text to people according to the chosen column. I want to add an image sending option, but I don't know how):
function sendEmails() {
var sheet = SpreadsheetApp.getActiveSheet();
var startRow = 120;
var numRows = 2;
var dataRange = sheet.getRange(startRow, 1, numRows, 2)
// Fetch values for each row in the Range.
var data = dataRange.getValues();
for (i in data) {
var row = data[i];
var emailAddress = row[1];
var message = row[5];
var subject = row[6];
MailApp.sendEmail(emailAddress, subject, message);
}
}