0
我需要修改此代碼以電子郵件發送名單中的數據名單「(數據」列1(A), 列表中的人員這是可能的,但仍然能夠用電子郵件發送圖表?修改電子郵件從工作表中包含的列表
function
emailCharts(sheet,emails,emailSubject){
var targetspreadsheet = SpreadsheetApp.getActiveSpreadsheet(); // Active spreadsheet of the key file
var sheet = targetspreadsheet.getSheetByName('Overview'); // Change the sheet name
var emailSubject = 'absence review ';
var emails = ""; // your email ID
var charts = sheet.getCharts();
if(charts.length==0){
MailApp.sendEmail({
to: emails,
subject: "ERROR:"+emailSubject,
htmlBody: "No charts in the spreadsheet"});
return;
}
var chartBlobs=new Array(charts.length);
var emailBody="Charts<br>";
var emailImages={};
for(var i=0;i<charts.length;i++){
var builder = charts[i].modify();
builder.setOption('vAxis.format', '#');
var newchart = builder.build();
chartBlobs[i]= newchart.getAs('image/png');
emailBody= emailBody + "<p align='center'><img src='cid:chart"+i+"'> </p>";
emailImages["chart"+i]= chartBlobs[i];
}
MailApp.sendEmail({
to: emails,
subject: emailSubject,
htmlBody: emailBody,
inlineImages:emailImages});
}
任何幫助,請
你好,這無法發送電子郵件收件人沒有(第30行,文件「的emailer」) –
你必須與行號粘貼在這裏的代碼即可。 –
此代碼將無法發送,除非您在調用該函數時通過電子郵件地址作爲第二個參數。您關於如何發送到列表中的所有地址的問題似乎與此特定錯誤無關。您是否想要爲每個收件人發送一封電子郵件,或將它們全部作爲同一電子郵件的收件人? –