我正在尝试创建一个电子表格自动化创建谷歌脚本,该脚本将电子邮件发送给从电子表格中获取值的特定人员。我有一个专栏提到了提及日期和时间。我想按照预定日期发送电子邮件,有没有人知道我的功能如何提及
+----------------------+---------------+-------------+-------------+
+ Schedule + Email + Subject + Message +
+----------------------+---------------+-------------+-------------+
+ 04/22/2015 18:00:00 + abc@abc.com + Hi + Hi +
+----------------------+---------------+-------------+-------------+
+ 04/25/2015 14:00:00 + def@gmail.com + Hi + Hi +
+----------------------+---------------+-------------+-------------+
function sendEmails() {
for (k = programFirstRow; k < totalProgramRows + 1; k++)
{
var sheet = SpreadsheetApp.getActiveSheet();
var startRow = 2; // First row of data to process
var numRows = 2; // Number of rows to process
// Fetch the range of cells A2:B3
var sendDate = SendSheet.getRange("A"+k).getValues();
var emailAddress = SendSheet.getRange("B"+k).getValues();
var Subject = SendSheet.getRange("C"+k).getValues();
var message = SendSheet.getRange("D"+k).getValues();
// Fetch values for each row in the Range.
MailApp.sendEmail(emailAddress, subject, message);
}
}
答案 0 :(得分:0)